[vlc-devel] [vlc-commits] demux: avformat: use guess rate instead of timebase

Rémi Denis-Courmont remi at remlab.net
Wed Jun 13 18:38:53 CEST 2018


This breaks the build, please revert.

372c7cf22c2f0074ca51ba634e620c7ba65733f2 is the first bad commit
commit 372c7cf22c2f0074ca51ba634e620c7ba65733f2
Author: Francois Cartegnie <fcvlcdev at free.fr>
Date:   Tue Jun 12 17:04:21 2018 +0200

    demux: avformat: use guess rate instead of timebase
    
    contains same code, and
    packet time base can be != from the real rate (ex: flv)

:040000 040000 e33039a9b030c7d18ace220de6d00651a4b61041 
0430c7f15943949a4e2ee8121c3fb08df6946886 M      modules


Le keskiviikkona 13. kesäkuuta 2018, 16.30.22 EEST Francois Cartegnie a écrit 
:
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 12
> 17:04:21 2018 +0200| [372c7cf22c2f0074ca51ba634e620c7ba65733f2] |
> committer: Francois Cartegnie
> 
> demux: avformat: use guess rate instead of timebase
> 
> contains same code, and
> packet time base can be != from the real rate (ex: flv)
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=372c7cf22c2f0074ca5
> > 1ba634e620c7ba65733f2
> ---
> 
>  modules/demux/avformat/demux.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
> index 3e3d40f0ef..397bf003d3 100644
> --- a/modules/demux/avformat/demux.c
> +++ b/modules/demux/avformat/demux.c
> @@ -436,15 +436,14 @@ int avformat_OpenDemux( vlc_object_t *p_this )
> 
>  # warning FIXME: implement palette transmission
>              psz_type = "video";
> -#if (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55, 20, 0))
> -            es_fmt.video.i_frame_rate = s->time_base.num;
> -            es_fmt.video.i_frame_rate_base = s->time_base.den;
> -            if( s->codec->ticks_per_frame > 0 )
> -                es_fmt.video.i_frame_rate_base *=
> s->codec->ticks_per_frame; -#else
> -            es_fmt.video.i_frame_rate = s->codec->time_base.num;
> -            es_fmt.video.i_frame_rate_base = s->codec->time_base.den *
> __MAX( s->codec->ticks_per_frame, 1 ); -#endif
> +
> +            AVRational rate = av_guess_frame_rate( p_sys->ic, s, NULL );
> +            if( rate.den && rate.num )
> +            {
> +                es_fmt.video.i_frame_rate = rate.num;
> +                es_fmt.video.i_frame_rate_base = rate.den;
> +            }
> +
>              es_fmt.video.i_sar_num = s->sample_aspect_ratio.num;
>              if (s->sample_aspect_ratio.num > 0)
>                  es_fmt.video.i_sar_den = s->sample_aspect_ratio.den;
> 
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits


-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list