Commit 3c8d75e6 authored by Michael Niedermayer's avatar Michael Niedermayer

Only set duration for streams where it is likely correct.

Fixes issue1120

Originally committed as revision 21620 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bce8840a
...@@ -415,7 +415,6 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -415,7 +415,6 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->nb_frames = get_le32(pb); st->nb_frames = get_le32(pb);
st->start_time = 0; st->start_time = 0;
st->duration = st->nb_frames;
get_le32(pb); /* buffer size */ get_le32(pb); /* buffer size */
get_le32(pb); /* quality */ get_le32(pb); /* quality */
ast->sample_size = get_le32(pb); /* sample ssize */ ast->sample_size = get_le32(pb); /* sample ssize */
...@@ -442,6 +441,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -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); av_log(s, AV_LOG_ERROR, "unknown stream type %X\n", tag1);
goto fail; goto fail;
} }
if(ast->sample_size == 0)
st->duration = st->nb_frames;
ast->frame_offset= ast->cum_len; ast->frame_offset= ast->cum_len;
url_fskip(pb, size - 12 * 4); url_fskip(pb, size - 12 * 4);
break; break;
......
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