[vlc-commits] demux: avformat: fix build with guess_rate / libav

Francois Cartegnie git at videolan.org
Thu Jun 14 19:10:16 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jun 14 18:43:47 2018 +0200| [2fb02b9461e8e1b875dad74bae2e28c7e63a09f3] | committer: Francois Cartegnie

demux: avformat: fix build with guess_rate / libav

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

 modules/demux/avformat/demux.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index de66091059..98b4cacc42 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -437,7 +437,19 @@ int avformat_OpenDemux( vlc_object_t *p_this )
 # warning FIXME: implement palette transmission
             psz_type = "video";
 
-            AVRational rate = av_guess_frame_rate( p_sys->ic, s, NULL );
+            AVRational rate;
+#if (LIBAVUTIL_VERSION_MICRO < 100) /* libav */
+# if (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55, 20, 0))
+            rate.num = s->time_base.num;
+            rate.den = s->time_base.den;
+# else
+            rate.num = s->codec->time_base.num;
+            rate.den = s->codec->time_base.den;
+# endif
+            rate.den *= __MAX( s->codec->ticks_per_frame, 1 );
+#else /* ffmpeg */
+            rate = av_guess_frame_rate( p_sys->ic, s, NULL );
+#endif
             if( rate.den && rate.num )
             {
                 es_fmt.video.i_frame_rate = rate.num;



More information about the vlc-commits mailing list