demux: avformat: fix build with guess_ar / libav
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 14 Jun 2018 16:49:07 +0000 (18:49 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 14 Jun 2018 17:10:08 +0000 (19:10 +0200)
modules/demux/avformat/demux.c

index 98b4cac..fc3bd2d 100644 (file)
@@ -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;