[FFmpeg-cvslog] r10138 - trunk/libavformat/utils.c

michael subversion
Sat Aug 18 02:45:44 CEST 2007


Author: michael
Date: Sat Aug 18 02:45:44 2007
New Revision: 10138

Log:
there is no gurarantee that every stream will
have an start_time found (though it is likely),
so check that the start_time is defined before
calculating a duration.
 (patch by neilb suse de)


Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	(original)
+++ trunk/libavformat/utils.c	Sat Aug 18 02:45:44 2007
@@ -1551,7 +1551,8 @@ static void av_estimate_timings_from_pts
             break;
         read_size += pkt->size;
         st = ic->streams[pkt->stream_index];
-        if (pkt->pts != AV_NOPTS_VALUE) {
+        if (pkt->pts != AV_NOPTS_VALUE &&
+            st->start_time != AV_NOPTS_VALUE) {
             end_time = pkt->pts;
             duration = end_time - st->start_time;
             if (duration > 0) {




More information about the ffmpeg-cvslog mailing list