[vlc-commits] faad: fix Ambisonics AAC order 1 streams
Adrien Maglo
git at videolan.org
Wed May 16 19:09:33 CEST 2018
vlc/vlc-3.0 | branch: master | Adrien Maglo <magsoft at videolan.org> | Mon May 14 16:55:01 2018 +0200| [81a9b7a4b7c426ee3a3c0175ab975ec4f000a6fb] | 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>
(cherry picked from commit b2d36c54332a54d3a5ef2f927201be7a13adf30f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=81a9b7a4b7c426ee3a3c0175ab975ec4f000a6fb
---
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 cd415b6c5c..2a956aa753 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 = popcount(p_dec->fmt_out.audio.i_physical_channels);
- }
+ p_dec->fmt_out.audio.i_channels = 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