[vlc-devel] [PATCH 2/2] decoder: update fmt_in if packetizer format changed
Rémi Denis-Courmont
remi at remlab.net
Wed Jul 29 14:06:37 CEST 2015
Le 2015-07-29 14:58, Thomas Guillem a écrit :
> ---
> src/input/decoder.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 41cca5e..0eb39e6 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -990,7 +990,8 @@ static void DecoderProcessVideo( decoder_t
> *p_dec, block_t *p_block, bool b_flus
> while( (p_packetized_block =
> p_packetizer->pf_packetize( p_packetizer, p_block ?
> &p_block : NULL )) )
> {
> - if( p_packetizer->fmt_out.i_extra &&
> !p_dec->fmt_in.i_extra )
> + if( p_packetizer->fmt_out.i_extra &&
> !p_dec->fmt_in.i_extra
> + || !VOUT_FMTS_IDENTICAL( &p_packetizer->fmt_out.video,
> &p_dec->fmt_in.video ) )
> {
> es_format_Clean( &p_dec->fmt_in );
> es_format_Copy( &p_dec->fmt_in,
> &p_packetizer->fmt_out );
> @@ -1169,7 +1170,8 @@ static void DecoderProcessAudio( decoder_t
> *p_dec, block_t *p_block, bool b_flus
> while( (p_packetized_block =
> p_packetizer->pf_packetize( p_packetizer, p_block ?
> &p_block : NULL )) )
> {
> - if( p_packetizer->fmt_out.i_extra &&
> !p_dec->fmt_in.i_extra )
> + if( p_packetizer->fmt_out.i_extra &&
> !p_dec->fmt_in.i_extra
> + || !AOUT_FMTS_IDENTICAL( &p_packetizer->fmt_out.audio,
> &p_dec->fmt_in.audio ) )
AOUT_FMTS_IDENTICAL is intended for audio output formats, not for coded
formats.
Besides, this code really is only meant to update the extra data (and
video SAR). Updating anything else is pretty much impossible with the
current design since the decoder is probed and instantiated before, not
after, the packetizer.
> {
> es_format_Clean( &p_dec->fmt_in );
> es_format_Copy( &p_dec->fmt_in,
> &p_packetizer->fmt_out );
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list