[vlc-commits] faad: fix Ambisonics AAC order 1 streams

Adrien Maglo git at videolan.org
Wed May 16 19:07:36 CEST 2018


vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Mon May 14 16:55:01 2018 +0200| [b2d36c54332a54d3a5ef2f927201be7a13adf30f] | committer: Jean-Baptiste Kempf

faad: fix Ambisonics AAC order 1 streams

Reorder properly the audio channels.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/faad.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index b31d329d3b..e3c9e0405f 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -529,12 +529,23 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
                 }
                 else pi_faad_channels_positions[i] = 0;
             }
+        }
+        else if (p_dec->fmt_out.audio.channel_type == AUDIO_CHANNEL_TYPE_AMBISONICS
+            && frame.channels == 4)
+        {
+            pi_faad_channels_positions[0] = AOUT_CHAN_REARCENTER;
+            pi_faad_channels_positions[1] = AOUT_CHAN_LEFT;
+            pi_faad_channels_positions[2] = AOUT_CHAN_RIGHT;
+            pi_faad_channels_positions[3] = AOUT_CHAN_CENTER;
+            p_dec->fmt_out.audio.i_physical_channels =
+                AOUT_CHAN_CENTER | AOUT_CHAN_LEFT
+                | AOUT_CHAN_RIGHT | AOUT_CHAN_REARCENTER;
+        }
 
-            b_reorder = aout_CheckChannelReorder( pi_faad_channels_positions, NULL,
-                p_dec->fmt_out.audio.i_physical_channels, pi_neworder_table );
+        b_reorder = aout_CheckChannelReorder( pi_faad_channels_positions, NULL,
+            p_dec->fmt_out.audio.i_physical_channels, pi_neworder_table );
 
-            p_dec->fmt_out.audio.i_channels = vlc_popcount(p_dec->fmt_out.audio.i_physical_channels);
-        }
+        p_dec->fmt_out.audio.i_channels = vlc_popcount(p_dec->fmt_out.audio.i_physical_channels);
 
         if( !decoder_UpdateAudioFormat( p_dec ) && p_dec->fmt_out.audio.i_channels > 0 )
             p_out = decoder_NewAudioBuffer( p_dec, frame.samples / p_dec->fmt_out.audio.i_channels );



More information about the vlc-commits mailing list