Commit 2791ecbf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avformat: read time base from stream directly (refs #18697)

parent 9a357a8f
......@@ -441,8 +441,15 @@ int 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
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