[vlc-commits] mediacodec: move aspect ratio handling

Thomas Guillem git at videolan.org
Thu Sep 3 14:30:25 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Sep  1 17:25:25 2015 +0200| [ab7cd5567bfe533a246e25872715cc685904def9] | committer: Thomas Guillem

mediacodec: move aspect ratio handling

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

 modules/codec/omxil/mediacodec.c |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 5c0ea92..605531e 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -772,6 +772,18 @@ static int Video_ProcessOutput(decoder_t *p_dec, mc_api_out *p_out,
     {
         picture_t *p_pic = NULL;
 
+        /* Use the aspect ratio provided by the input (ie read from packetizer).
+         * Don't check the current value of the aspect ratio in fmt_out, since we
+         * want to allow changes in it to propagate. */
+        if (p_dec->fmt_in.video.i_sar_num != 0 && p_dec->fmt_in.video.i_sar_den != 0
+         && (p_dec->fmt_out.video.i_sar_num != p_dec->fmt_in.video.i_sar_num ||
+             p_dec->fmt_out.video.i_sar_den != p_dec->fmt_in.video.i_sar_den))
+        {
+            p_dec->fmt_out.video.i_sar_num = p_dec->fmt_in.video.i_sar_num;
+            p_dec->fmt_out.video.i_sar_den = p_dec->fmt_in.video.i_sar_den;
+            p_sys->b_update_format = true;
+        }
+
         if (p_sys->b_update_format)
         {
             p_sys->b_update_format = false;
@@ -1325,21 +1337,8 @@ static void Video_OnFlush(decoder_t *p_dec)
 
 static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block)
 {
-    decoder_sys_t *p_sys = p_dec->p_sys;
     picture_t *p_out = NULL;
 
-    /* Use the aspect ratio provided by the input (ie read from packetizer).
-     * Don't check the current value of the aspect ratio in fmt_out, since we
-     * want to allow changes in it to propagate. */
-    if (p_dec->fmt_in.video.i_sar_num != 0 && p_dec->fmt_in.video.i_sar_den != 0
-     && (p_dec->fmt_out.video.i_sar_num != p_dec->fmt_in.video.i_sar_num ||
-         p_dec->fmt_out.video.i_sar_den != p_dec->fmt_in.video.i_sar_den))
-    {
-        p_dec->fmt_out.video.i_sar_num = p_dec->fmt_in.video.i_sar_num;
-        p_dec->fmt_out.video.i_sar_den = p_dec->fmt_in.video.i_sar_den;
-        p_sys->b_update_format = true;
-    }
-
     if (DecodeCommon(p_dec, pp_block, &p_out, NULL))
         return NULL;
     return p_out;



More information about the vlc-commits mailing list