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

Thomas Guillem git at videolan.org
Fri Feb 23 17:12:30 CET 2018


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

mediacodec: don't override sar if already correct

(cherry picked from commit c70412a049edad5d91ead4f4efa7736cb2e2b82e)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 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 21f4e037ea..0090182bcf 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -441,9 +441,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))
@@ -715,6 +712,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