Commit bf494092 authored by Neil Brown's avatar Neil Brown Committed by Michael Niedermayer

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
parent df886e7e
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment