[vlc-devel] [RFC] audio: let VLC decode more than 9 audio channels

Ilkka Ollakka ileoo at videolan.org
Wed Oct 7 06:36:35 CEST 2015

On Tue, Oct 06, 2015 at 05:53:17PM +0200, Emeric Grange wrote:


> VLC has an hardcoded limit (AOUT_CHAN_MAX=9) determining how many audio channels
> can be decoded and processed.
> Increasing this limit work well for some use cases, eg: using libvlc to decode PCM
> files with 16 channels, getting the result through vlc_player_audiocallback()
> and outputting it with third party libraries, but a lot of audio filters should
> be impacted as well.
> These channels doesn't have to correspond to "real" output speakers, so the code
> related to new speakers from the WAVE_FORMAT_PCM is just here to avoid VLC
> segfaulting when playing these files directly.

I think biggest issue has been, that nobody has yet tought should those
extra channels be mapped somehow/mixed to other channes when playing
back, or just ignored (in channelmixers). And is there any actual
channelmappings between 8.1 and 16 channels?

> It would probably be better to introduce a new ADEC_CHAN_MAX with an higher value
> than AOUT_CHAN_MAX, so decode can still be achieved but processing would be blocked.
> What do you think?

I think we should just use AOUT_CHAN_MAX.

> ---
> diff --git a/include/vlc_es.h b/include/vlc_es.h
> index 97cdb78..bf0bc11 100644
> --- a/include/vlc_es.h
> +++ b/include/vlc_es.h
> @@ -108,13 +108,28 @@ struct audio_format_t
>  #define AOUT_CHAN_REARRIGHT         0x40
>  #define AOUT_CHAN_MIDDLELEFT        0x100
>  #define AOUT_CHAN_MIDDLERIGHT       0x200
> -#define AOUT_CHAN_LFE               0x1000
> +
> +#define AOUT_CHAN_SIDE_LEFT         0x100
> +#define AOUT_CHAN_SIDE_RIGHT        0x200

I think you should start that side_left from 0x1000 or is it
intentionally same as chan_middleleft?

Ilkka Ollakka
Suspicion always haunts the guilty mind.
		-- Wm. Shakespeare
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20151007/7fbb9ced/attachment.sig>

More information about the vlc-devel mailing list