[vlc-commits] decoder: Give packetizer aspect ratio to decoder.

Julian Scheel git at videolan.org
Fri Feb 7 19:44:35 CET 2014


vlc | branch: master | Julian Scheel <julian at jusst.de> | Fri Sep 27 14:32:39 2013 +0200| [5f77310fb9d7bbe3b5c19a01903cb93ec362d114] | committer: Martin Storsjö

decoder: Give packetizer aspect ratio to decoder.

When the packetizer detects a valid pixel aspect ratio this should be
forwarded to the decoders input format. This is helpful for decoder modules
which do not expose the aspect ratio on their own.

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 src/input/decoder.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index d7caf2d..995851f 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1569,6 +1569,21 @@ static void DecoderProcessVideo( decoder_t *p_dec, block_t *p_block, bool b_flus
                 es_format_Clean( &p_dec->fmt_in );
                 es_format_Copy( &p_dec->fmt_in, &p_packetizer->fmt_out );
             }
+
+            /* If the packetizer provides aspect ratio information, pass it
+             * to the decoder as a hint if the decoder itself can't provide
+             * it. Copy it regardless of the current value of the decoder input
+             * format aspect ratio, to properly propagate changes in aspect
+             * ratio. */
+            if( p_packetizer->fmt_out.video.i_sar_num > 0 &&
+                    p_packetizer->fmt_out.video.i_sar_den > 0)
+            {
+                p_dec->fmt_in.video.i_sar_num =
+                    p_packetizer->fmt_out.video.i_sar_num;
+                p_dec->fmt_in.video.i_sar_den=
+                    p_packetizer->fmt_out.video.i_sar_den;
+            }
+
             if( p_packetizer->pf_get_cc )
                 DecoderGetCc( p_dec, p_packetizer );
 



More information about the vlc-commits mailing list