[FFmpeg-devel] [PATCH 27/28] fixed: wrong fps for rmvb files (patch by taxigps)

Alexander Strange astrange
Wed Jun 30 11:13:52 CEST 2010


On Jun 30, 2010, at 2:09 AM, Mans Rullgard wrote:

> From: Cory Fields <theuni-nospam- at xbmc.org>

Is there a sample for this one, or do all rmvb files have obviously bad times?


> ---
> libavformat/rmdec.c |    7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
> index 436a7e0..b9061a2 100644
> --- a/libavformat/rmdec.c
> +++ b/libavformat/rmdec.c
> @@ -294,18 +294,17 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb,
>             goto fail1;
>         st->codec->width = get_be16(pb);
>         st->codec->height = get_be16(pb);
> -        st->codec->time_base.num= 1;
> +        st->codec->time_base.num= 1 << 16;
>         fps= get_be16(pb);
>         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
>         get_be32(pb);
> -        fps2= get_be16(pb);
> -        get_be16(pb);
> +        fps2= get_be32(pb);
> 
>         if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (url_ftell(pb) - codec_pos))) < 0)
>             return ret;
> 
> //        av_log(s, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2);
> -        st->codec->time_base.den = fps * st->codec->time_base.num;
> +        st->codec->time_base.den = fps2;
>         //XXX: do we really need that?
>         switch(st->codec->extradata[4]>>4){
>         case 1: st->codec->codec_id = CODEC_ID_RV10; break;
> -- 
> 1.7.1.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel




More information about the ffmpeg-devel mailing list