diff options
author | Neil Brown <[email protected]> | 2007-08-18 00:45:44 +0000 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2007-08-18 00:45:44 +0000 |
commit | bf494092b03f107e35ab6ad70be324f23a193c2b (patch) | |
tree | 8c8e1f6c00240128ee0be73a1c59c0eeeda1a957 | |
parent | df886e7e025d133deb87282722f97cf7455f4d97 (diff) |
There is no guarantee that every stream will
have a start_time found (though it is likely),
so check that the start_time is defined before
calculating a duration.
(patch by neilb suse de)
Originally committed as revision 10138 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 9663a99f88..0eba3e619c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1551,7 +1551,8 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, offset_t old_offse 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) { |