Author: gkovacs
Date: Wed Aug 26 07:47:59 2009
New Revision: 5287

Log:
remove streams_offset_from_playidx

Modified:
   concat/libavformat/avplaylist.c
   concat/libavformat/avplaylist.h
   concat/libavformat/concatgen.c
   concat/libavformat/playlist.c

Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c     Wed Aug 26 07:35:17 2009        (r5286)
+++ concat/libavformat/avplaylist.c     Wed Aug 26 07:47:59 2009        (r5287)
@@ -183,12 +183,3 @@ int av_playlist_localstidx_from_streamid
     }
     return stream_index - prev;
 }
-
-int av_playlist_streams_offset_from_playidx(AVPlaylistContext *ctx, int 
playidx)
-{
-    int i, total;
-    i = total = 0;
-    while (playidx > i)
-        total = ctx->nb_streams_list[i++];
-    return total;
-}

Modified: concat/libavformat/avplaylist.h
==============================================================================
--- concat/libavformat/avplaylist.h     Wed Aug 26 07:35:17 2009        (r5286)
+++ concat/libavformat/avplaylist.h     Wed Aug 26 07:47:59 2009        (r5287)
@@ -102,11 +102,4 @@ int av_playlist_stream_index_from_time(A
  */
 int av_playlist_localstidx_from_streamidx(AVPlaylistContext *ctx, int 
stream_index);
 
-/** @brief Calculates the stream offset which corresponds to the given 
playlist item index.
- *  @param ctx AVPlaylistContext within which the list of playlist elements 
and durations are stored.
- *  @param playidx Playlist item index, the index of the child demuxer within 
ctx->formatcontext_list.
- *  @return Returns the stream offset, which is global stream index - local 
stream index.
- */
-int av_playlist_streams_offset_from_playidx(AVPlaylistContext *ctx, int 
playidx);
-
 #endif /* AVFORMAT_AVPLAYLIST_H */

Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c      Wed Aug 26 07:35:17 2009        (r5286)
+++ concat/libavformat/concatgen.c      Wed Aug 26 07:47:59 2009        (r5287)
@@ -54,7 +54,9 @@ int ff_concatgen_read_packet(AVFormatCon
         }
         if (ret >= 0) {
             if (pkt) {
-                int streams_offset = 
av_playlist_streams_offset_from_playidx(ctx, ctx->pe_curidx);
+                int streams_offset = 0;
+                if (ctx->pe_curidx > 0)
+                    streams_offset = ctx->nb_streams_list[ctx->pe_curidx - 1];
                 stream_index = av_playlist_localstidx_from_streamidx(ctx, 
pkt->stream_index);
                 pkt->stream_index = stream_index + streams_offset;
                 if (!ic->streams[stream_index]->codec->has_b_frames ||

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c       Wed Aug 26 07:35:17 2009        (r5286)
+++ concat/libavformat/playlist.c       Wed Aug 26 07:47:59 2009        (r5287)
@@ -99,7 +99,9 @@ int ff_playlist_set_streams(AVPlaylistCo
     if (!(s = ctx->master_formatcontext))
         return 0;
     ic = ctx->formatcontext_list[ctx->pe_curidx];
-    int offset = av_playlist_streams_offset_from_playidx(ctx, ctx->pe_curidx);
+    int offset = 0;
+    if (ctx->pe_curidx > 0)
+        offset = ctx->nb_streams_list[ctx->pe_curidx - 1];
     ic->iformat->read_header(ic, NULL);
     for (i = 0; i < ic->nb_streams; ++i) {
         s->streams[offset + i] = ic->streams[i];
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to