[vlc-commits] vorbisenc: set maximum channels to 7.1

Thomas Guillem git at videolan.org
Thu Jan 18 17:37:30 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 18 15:58:37 2018 +0100| [81c5c5820023d2292ec75901fb135ad31a17cea8] | committer: Thomas Guillem

vorbisenc: set maximum channels to 7.1

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=81c5c5820023d2292ec75901fb135ad31a17cea8
---

 modules/codec/vorbis.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c
index 6c30af825c..2488255c16 100644
--- a/modules/codec/vorbis.c
+++ b/modules/codec/vorbis.c
@@ -781,6 +781,11 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_enc->fmt_in.i_codec  = VLC_CODEC_FL32;
     p_enc->fmt_out.i_codec = VLC_CODEC_VORBIS;
 
+    if( p_enc->fmt_in.audio.i_channels >= ARRAY_SIZE(pi_channels_maps) )
+    {
+        p_enc->fmt_in.audio.i_channels = ARRAY_SIZE(pi_channels_maps) - 1;
+        msg_Warn( p_enc, "lowering channel count to %u", p_enc->fmt_in.audio.i_channels );
+    }
     config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
 
     i_quality = var_GetInteger( p_enc, ENC_CFG_PREFIX "quality" );



More information about the vlc-commits mailing list