diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-03-21 23:17:05 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-22 13:15:17 +0100 |
commit | 015fd02babd2e1de55472c17b94f66b98152d403 (patch) | |
tree | 656e4ce7f9822a8ca439f51be36fd0728519fcaa | |
parent | eb9841297a513cdaf405deecb13daff7501e57a6 (diff) | |
download | ffmpeg-015fd02babd2e1de55472c17b94f66b98152d403.tar.gz |
electronicarts vp6: set duration of video stream
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/electronicarts.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 968682af7e..0fb66970d6 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -66,6 +66,7 @@ typedef struct EaDemuxContext { enum CodecID video_codec; AVRational time_base; int width, height; + int nb_frames; int video_stream_index; enum CodecID audio_codec; @@ -274,7 +275,9 @@ static int process_video_header_vp6(AVFormatContext *s) EaDemuxContext *ea = s->priv_data; AVIOContext *pb = s->pb; - avio_skip(pb, 16); + avio_skip(pb, 8); + ea->nb_frames = avio_rl32(pb); + avio_skip(pb, 4); ea->time_base.den = avio_rl32(pb); ea->time_base.num = avio_rl32(pb); ea->video_codec = CODEC_ID_VP6; @@ -433,6 +436,7 @@ static int ea_read_header(AVFormatContext *s) st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = ea->width; st->codec->height = ea->height; + st->duration = st->nb_frames = ea->nb_frames; if (ea->time_base.num) avpriv_set_pts_info(st, 64, ea->time_base.num, ea->time_base.den); st->r_frame_rate = st->avg_frame_rate = (AVRational){ea->time_base.den, |