[vlc-devel] [PATCH 2/2] omxil: Passthrough aspect ratio from input format.

Julian Scheel julian at jusst.de
Fri Sep 6 11:28:29 CEST 2013


If the input format has a valid pixel aspect ratio set (ie from the
packetizer) pass this into the output format. This helps for omx
implementations which do not report the aspect ratio.
For omx implementations which provide aspect ratio information give these
precedence over the incoming values.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 modules/codec/omxil/omxil.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 0fafedf..de79d3a 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -1229,6 +1229,16 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         return NULL;
     }
 
+    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 == 0 ||
+             p_dec->fmt_out.video.i_sar_den == 0 ||
+             strncmp(p_sys->psz_component, "OMX.broadcom.", 13)))
+    {
+        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;
+    }
+
     /* Take care of decoded frames first */
     while(!p_pic)
     {
-- 
1.8.4




More information about the vlc-devel mailing list