# HG changeset patch # User michael # Date 1187397944 0 # Node ID e1fdab28da806183b2d7a43766b08c43375bae12 # Parent 3306dae77205f7fda45215f99dc9a2b4c903de41 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) diff -r 3306dae77205 -r e1fdab28da80 utils.c --- a/utils.c Sat Aug 18 00:44:14 2007 +0000 +++ b/utils.c Sat Aug 18 00:45:44 2007 +0000 @@ -1551,7 +1551,8 @@ 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) {