[FFmpeg-soc] [soc]: r5230 - concat/libavformat/concatgen.c

gkovacs subversion at mplayerhq.hu
Mon Aug 24 05:20:43 CEST 2009


Author: gkovacs
Date: Mon Aug 24 05:20:43 2009
New Revision: 5230

Log:
remove manual caching of time offsets in read_packet since it's already done in av_playlist_time_offset

Modified:
   concat/libavformat/concatgen.c

Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c	Mon Aug 24 05:16:43 2009	(r5229)
+++ concat/libavformat/concatgen.c	Mon Aug 24 05:20:43 2009	(r5230)
@@ -57,16 +57,9 @@ int ff_concatgen_read_packet(AVFormatCon
                 pkt->stream_index = stream_index + streams_offset;
                 if (!ic->streams[stream_index]->codec->has_b_frames ||
                     ic->streams[stream_index]->codec->codec->id == CODEC_ID_MPEG1VIDEO) {
-                    static int cached_streams_offset = -1;
-                    static int64_t time_offset_avbase = 0;
-                    int time_offset_localbase;
-                    if (cached_streams_offset != streams_offset) { // must recompute timestamp offset
-                        cached_streams_offset = streams_offset;
-                        time_offset_avbase = av_playlist_time_offset(ctx->durations, streams_offset);
-                    }
-                    time_offset_localbase = av_rescale_q(time_offset_avbase,
-                                                         AV_TIME_BASE_Q,
-                                                         ic->streams[stream_index]->time_base);
+                    int64_t time_offset_localbase = av_rescale_q(av_playlist_time_offset(ctx->durations, streams_offset),
+                                                                 AV_TIME_BASE_Q,
+                                                                 ic->streams[stream_index]->time_base);
                     pkt->dts += time_offset_localbase;
                     if (pkt->pts != AV_NOPTS_VALUE)
                         pkt->pts += time_offset_localbase;


More information about the FFmpeg-soc mailing list