Commit 372c7cf2 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: avformat: use guess rate instead of timebase

contains same code, and
packet time base can be != from the real rate (ex: flv)
parent 565d5c50
......@@ -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;
......
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