[vlc-commits] mediacodec: don't override sar if already correct

Thomas Guillem git at videolan.org
Fri Feb 23 17:10:27 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb 23 17:08:13 2018 +0100| [c70412a049edad5d91ead4f4efa7736cb2e2b82e] | committer: Thomas Guillem

mediacodec: don't override sar if already correct

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

 modules/codec/omxil/mediacodec.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 535086a412..455f0fc7f4 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -440,9 +440,6 @@ static int UpdateVout(decoder_t *p_dec)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    p_dec->fmt_out.video.i_sar_num = 1;
-    p_dec->fmt_out.video.i_sar_den = 1;
-
     if ((p_dec->fmt_in.i_codec == VLC_CODEC_MPGV ||
          p_dec->fmt_in.i_codec == VLC_CODEC_MP2V) &&
         (p_sys->video.i_mpeg_dar_num * p_sys->video.i_mpeg_dar_den != 0))
@@ -714,6 +711,12 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
                 p_sys->video.i_angle = 0;
 
             p_dec->fmt_out.video = p_dec->fmt_in.video;
+            if (p_dec->fmt_out.video.i_sar_num * p_dec->fmt_out.video.i_sar_den == 0)
+            {
+                p_dec->fmt_out.video.i_sar_num = 1;
+                p_dec->fmt_out.video.i_sar_den = 1;
+            }
+
             p_sys->video.i_input_width =
             p_dec->fmt_out.video.i_visible_width = p_dec->fmt_out.video.i_width;
             p_sys->video.i_input_height =



More information about the vlc-commits mailing list