[vlc-devel] [PATCH] Flac Packetizer issue

Jean-Baptiste Kempf jb at videolan.org
Tue May 15 14:39:38 CEST 2012


The lack of channels seem to be blocking transcoding of flac files
Ref #4179 #6400

This is not enough, it seems. Any idea what to do?
---
 modules/packetizer/flac.c |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c
index 1fef09a..5d1d5bd 100644
--- a/modules/packetizer/flac.c
+++ b/modules/packetizer/flac.c
@@ -90,6 +90,27 @@ struct decoder_sys_t
     unsigned int i_rate, i_channels, i_bits_per_sample;
 };
 
+static const int pi_channels_maps[9] =
+{
+    0,
+    AOUT_CHAN_CENTER,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
+    AOUT_CHAN_CENTER | AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_REARLEFT
+     | AOUT_CHAN_REARRIGHT,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT
+     | AOUT_CHAN_MIDDLERIGHT,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT
+     | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT
+     | AOUT_CHAN_LFE
+};
+
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -338,6 +359,11 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             if( p_sys->i_pts == p_sys->bytestream.p_block->i_pts )
                 p_sys->i_pts = p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
 
+            p_dec->fmt_out.audio.i_channels = p_sys->i_channels;
+            p_dec->fmt_out.audio.i_physical_channels =
+                p_dec->fmt_out.audio.i_original_channels =
+                    pi_channels_maps[p_sys->stream_info.channels];
+
             /* So p_block doesn't get re-added several times */
             *pp_block = block_BytestreamPop( &p_sys->bytestream );
 
-- 
1.7.10.2




More information about the vlc-devel mailing list