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

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


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jun 14 18:49:07 2018 +0200| [4df37da405319926de154833102ae1cfa48432de] | committer: Francois Cartegnie

demux: avformat: fix build with guess_ar / libav

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

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

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 98b4cacc42..fc3bd2d52c 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -456,7 +456,13 @@ int avformat_OpenDemux( vlc_object_t *p_this )
                 es_fmt.video.i_frame_rate_base = rate.den;
             }
 
-            AVRational ar = av_guess_sample_aspect_ratio( p_sys->ic, s, NULL );
+            AVRational ar;
+#if (LIBAVUTIL_VERSION_MICRO < 100) /* libav */
+            ar.num = s->sample_aspect_ratio.num;
+            ar.den = s->sample_aspect_ratio.den;
+#else
+            ar = av_guess_sample_aspect_ratio( p_sys->ic, s, NULL );
+#endif
             if( ar.num && ar.den )
             {
                 es_fmt.video.i_sar_den = ar.den;



More information about the vlc-commits mailing list