Commit 5f77310f authored by Julian Scheel's avatar Julian Scheel Committed by 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: default avatarMartin Storsjö <martin@martin.st>
parent a0da80b6
......@@ -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 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment