[vlc-commits] vorbisenc: setup channels from vorbis info

Thomas Guillem git at videolan.org
Fri Jan 19 12:01:32 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 18 15:59:27 2018 +0100| [0eacde7f7bfe9a940a6a7b233116459f07ec8ad8] | committer: Jean-Baptiste Kempf

vorbisenc: setup channels from vorbis info

(cherry picked from commit fdb8982c816ec9ee86b22797a08ecbba9fdcc6ac)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=0eacde7f7bfe9a940a6a7b233116459f07ec8ad8
---

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

diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c
index 2488255c16..04a22879d3 100644
--- a/modules/codec/vorbis.c
+++ b/modules/codec/vorbis.c
@@ -869,7 +869,16 @@ static int OpenEncoder( vlc_object_t *p_this )
         }
     }
 
+    assert(p_sys->vi.channels > 0 && (size_t) p_sys->vi.channels < ARRAY_SIZE(pi_channels_maps) );
+
+    p_enc->fmt_out.audio.i_channels = p_enc->fmt_in.audio.i_channels =
+        p_sys->vi.channels;
+
+    p_enc->fmt_out.audio.i_physical_channels =
+    p_enc->fmt_in.audio.i_physical_channels =
+        pi_channels_maps[p_sys->vi.channels];
     p_sys->i_channels = p_enc->fmt_in.audio.i_channels;
+
     p_sys->i_last_block_size = 0;
     p_sys->i_samples_delay = 0;
 



More information about the vlc-commits mailing list