[vlc-devel] [PATCH 11/12] codec: araw: supports output with channels > AOUT_CHAN_MAX
Rémi Denis-Courmont
remi at remlab.net
Fri Jul 7 17:07:39 CEST 2017
Le 7 juillet 2017 16:39:58 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>If the channel number is higher than AOUT_CHAN_MAX, don't set the
>physical
>mask, and just set the number of channels. A filter will take of
>dropping extra
>channels or doing an ambisonics conversion.
>---
> modules/codec/araw.c | 33 +++++++++++++++++++++------------
> 1 file changed, 21 insertions(+), 12 deletions(-)
>
>diff --git a/modules/codec/araw.c b/modules/codec/araw.c
>index e6206b4bc1..2c08413fee 100644
>--- a/modules/codec/araw.c
>+++ b/modules/codec/araw.c
>@@ -247,8 +247,7 @@ static int DecoderOpen( vlc_object_t *p_this )
> return VLC_EGENERIC;
> }
>
>- if( p_dec->fmt_in.audio.i_channels == 0 ||
>- p_dec->fmt_in.audio.i_channels > AOUT_CHAN_MAX )
>+ if( p_dec->fmt_in.audio.i_channels == 0 )
> {
> msg_Err( p_dec, "bad channels count (1-%i): %i",
> AOUT_CHAN_MAX, p_dec->fmt_in.audio.i_channels );
>@@ -275,18 +274,28 @@ static int DecoderOpen( vlc_object_t *p_this )
> p_dec->fmt_out.i_codec = format;
> p_dec->fmt_out.audio.i_format = format;
> p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
>- if( p_dec->fmt_in.audio.i_physical_channels )
>- p_dec->fmt_out.audio.i_physical_channels =
>-
>p_dec->fmt_in.audio.i_physical_channels;
>+ if( p_dec->fmt_in.audio.i_channels <= AOUT_CHAN_MAX )
>+ {
>+ if( p_dec->fmt_in.audio.i_physical_channels )
>+ p_dec->fmt_out.audio.i_physical_channels =
>+
>p_dec->fmt_in.audio.i_physical_channels;
>+ else
>+ p_dec->fmt_out.audio.i_physical_channels =
>+
>pi_channels_maps[p_dec->fmt_in.audio.i_channels];
>+ if( p_dec->fmt_in.audio.i_original_channels )
>+ p_dec->fmt_out.audio.i_original_channels =
>+
>p_dec->fmt_in.audio.i_original_channels;
>+ else
>+ p_dec->fmt_out.audio.i_original_channels =
>+
>p_dec->fmt_out.audio.i_physical_channels;
>+ }
> else
>+ {
>+ /* Unknown channel map, let the aout/filters decide what to do
>*/
>+ p_dec->fmt_out.audio.i_channels =
>p_dec->fmt_in.audio.i_channels;
> p_dec->fmt_out.audio.i_physical_channels =
>-
>pi_channels_maps[p_dec->fmt_in.audio.i_channels];
>- if( p_dec->fmt_in.audio.i_original_channels )
>- p_dec->fmt_out.audio.i_original_channels =
>-
>p_dec->fmt_in.audio.i_original_channels;
>- else
>- p_dec->fmt_out.audio.i_original_channels =
>-
>p_dec->fmt_out.audio.i_physical_channels;
>+ p_dec->fmt_out.audio.i_original_channels = 0;
>+ }
> aout_FormatPrepare( &p_dec->fmt_out.audio );
>
> p_sys->decode = decode;
>--
>2.11.0
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
Use ARRAY_SIZE
--
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170707/37199dcf/attachment.html>
More information about the vlc-devel
mailing list