<html><head></head><body><div class="gmail_quote">Le 7 juillet 2017 16:39:58 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">If the channel number is higher than AOUT_CHAN_MAX, don't set the physical<br />mask, and just set the number of channels. A filter will take of dropping extra<br />channels or doing an ambisonics conversion.<br />---<br /> modules/codec/araw.c | 33 +++++++++++++++++++++------------<br /> 1 file changed, 21 insertions(+), 12 deletions(-)<br /><br />diff --git a/modules/codec/araw.c b/modules/codec/araw.c<br />index e6206b4bc1..2c08413fee 100644<br />--- a/modules/codec/araw.c<br />+++ b/modules/codec/araw.c<br />@@ -247,8 +247,7 @@ static int DecoderOpen( vlc_object_t *p_this )<br /> return VLC_EGENERIC;<br /> }<br /> <br />- if( p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels == 0 ||<br />- p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels > AOUT_CHAN_MAX )<br />+ if( p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels == 0 )<br /> {<br /> msg_Err( p_dec, "bad channels count (1-%i): %i",<br /> AOUT_CHAN_MAX, p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels );<br />@@ -275,18 +274,28 @@ static int DecoderOpen( vlc_object_t *p_this )<br /> p_dec->fmt_out.i_codec = format;<br /> p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_format = format;<br /> p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_rate = p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_rate;<br />- if( p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_physical_channels )<br />- p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_physical_channels =<br />- p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_physical_channels;<br />+ if( p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels <= AOUT_CHAN_MAX )<br />+ {<br />+ if( p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_physical_channels )<br />+ p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_physical_channels =<br />+ p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_physical_channels;<br />+ else<br />+ p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_physical_channels =<br />+ pi_channels_maps[p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels];<br />+ if( p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_original_channels )<br />+ p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_original_channels =<br />+ p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_original_channels;<br />+ else<br />+ p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_original_channels =<br />+ p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_physical_channels;<br />+ }<br /> else<br />+ {<br />+ /* Unknown channel map, let the aout/filters decide what to do */<br />+ p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_channels = p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels;<br /> p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_physical_channels =<br />- pi_channels_maps[p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_channels];<br />- if( p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_original_channels )<br />- p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_original_channels =<br />- p_dec->fmt_<a href="http://in.audio">in.audio</a>.i_original_channels;<br />- else<br />- p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_original_channels =<br />- p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_physical_channels;<br />+ p_dec->fmt_<a href="http://out.audio">out.audio</a>.i_original_channels = 0;<br />+ }<br /> aout_FormatPrepare( &p_dec->fmt_<a href="http://out.audio">out.audio</a> );<br /> <br /> p_sys->decode = decode;</pre></blockquote></div><br clear="all">Use ARRAY_SIZE<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>