[vlc-commits] Flac Packetizer issue

Jean-Baptiste Kempf git at videolan.org
Sun Aug 5 23:59:59 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Aug  5 23:57:30 2012 +0200| [0e519f712db62f1c0f16983215e370af66f3a142] | committer: Jean-Baptiste Kempf

Flac Packetizer issue

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

This might not be enough, though

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

 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 );
 



More information about the vlc-commits mailing list