diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-02-03 00:35:10 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-02-03 00:35:10 +0000 |
commit | 3c8d75e65b526459a86d818ad9f98605a3f48576 (patch) | |
tree | 6b4dd4ee93e70c157f450f8db01bed015fe25ddb | |
parent | bce8840a4e45251b15ec21025e89770882fccb36 (diff) | |
download | ffmpeg-streaming-3c8d75e65b526459a86d818ad9f98605a3f48576.zip ffmpeg-streaming-3c8d75e65b526459a86d818ad9f98605a3f48576.tar.gz |
Only set duration for streams where it is likely correct.
Fixes issue1120
Originally committed as revision 21620 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/avidec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 3d68e47..7a2ee05 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -415,7 +415,6 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) st->nb_frames = get_le32(pb); st->start_time = 0; - st->duration = st->nb_frames; get_le32(pb); /* buffer size */ get_le32(pb); /* quality */ ast->sample_size = get_le32(pb); /* sample ssize */ @@ -442,6 +441,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) av_log(s, AV_LOG_ERROR, "unknown stream type %X\n", tag1); goto fail; } + if(ast->sample_size == 0) + st->duration = st->nb_frames; ast->frame_offset= ast->cum_len; url_fskip(pb, size - 12 * 4); break; |