[vlc-commits] avformat: read time base from stream directly (refs #18697)

Rémi Denis-Courmont git at videolan.org
Sat Nov 4 09:38:04 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov  4 10:09:37 2017 +0200| [2791ecbf11a9771057755d26534ca142d08e7d0c] | committer: Rémi Denis-Courmont

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2791ecbf11a9771057755d26534ca142d08e7d0c
---

 modules/demux/avformat/demux.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 2f3b907410..d53d15565d 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -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;



More information about the vlc-commits mailing list