[vlc-commits] auhal: add support for 8.0 and 8.1 output (close #8536)
Felix Paul Kühne
git at videolan.org
Tue Apr 30 14:46:12 CEST 2013
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Apr 30 14:45:55 2013 +0200| [3e3e5b514c4178f4f7bfb94a514c45ae5c5f84b7] | committer: Felix Paul Kühne
auhal: add support for 8.0 and 8.1 output (close #8536)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e3e5b514c4178f4f7bfb94a514c45ae5c5f84b7
---
modules/audio_output/auhal.c | 72 +++++++++++++++++++++++++++++++++++-------
1 file changed, 61 insertions(+), 11 deletions(-)
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index fea6322..a40ef5e 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -554,6 +554,28 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
memset (&new_layout, 0, sizeof(new_layout));
uint32_t chans_out[AOUT_CHAN_MAX];
+ /* Some channel abbreviations used below:
+ * L - left
+ * R - right
+ * C - center
+ * Ls - left surround
+ * Rs - right surround
+ * Cs - center surround
+ * Rls - rear left surround
+ * Rrs - rear right surround
+ * Lw - left wide
+ * Rw - right wide
+ * Lsd - left surround direct
+ * Rsd - right surround direct
+ * Lc - left center
+ * Rc - right center
+ * Ts - top surround
+ * Vhl - vertical height left
+ * Vhc - vertical height center
+ * Vhr - vertical height right
+ * Lt - left matrix total. for matrix encoded stereo.
+ * Rt - right matrix total. for matrix encoded stereo. */
+
switch(aout_FormatNbChannels(fmt)) {
case 1:
new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_Mono;
@@ -588,7 +610,7 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_AudioUnit_6_0; // L R Ls Rs C Cs
break;
case 7:
- new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A;
+ new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A; // L R C LFE Ls Rs Cs
chans_out[0] = AOUT_CHAN_LEFT;
chans_out[1] = AOUT_CHAN_RIGHT;
@@ -604,21 +626,49 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
break;
case 8:
- new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A;
+ if (fmt->i_physical_channels & (AOUT_CHAN_LFE)) {
+ new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A; // L R C LFE Ls Rs Lc Rc
+
+ chans_out[0] = AOUT_CHAN_LEFT;
+ chans_out[1] = AOUT_CHAN_RIGHT;
+ chans_out[2] = AOUT_CHAN_CENTER;
+ chans_out[3] = AOUT_CHAN_LFE;
+ chans_out[4] = AOUT_CHAN_MIDDLELEFT;
+ chans_out[5] = AOUT_CHAN_MIDDLERIGHT;
+ chans_out[6] = AOUT_CHAN_REARLEFT;
+ chans_out[7] = AOUT_CHAN_REARRIGHT;
+ } else {
+ new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_DTS_8_0_B; // Lc C Rc L R Ls Cs Rs
+
+ chans_out[0] = AOUT_CHAN_MIDDLELEFT;
+ chans_out[1] = AOUT_CHAN_CENTER;
+ chans_out[2] = AOUT_CHAN_MIDDLERIGHT;
+ chans_out[3] = AOUT_CHAN_LEFT;
+ chans_out[4] = AOUT_CHAN_RIGHT;
+ chans_out[5] = AOUT_CHAN_REARLEFT;
+ chans_out[6] = AOUT_CHAN_REARCENTER;
+ chans_out[7] = AOUT_CHAN_REARRIGHT;
+ }
+ p_aout->sys->chans_to_reorder = aout_CheckChannelReorder(NULL, chans_out, fmt->i_physical_channels, p_aout->sys->chan_table);
+ if (p_aout->sys->chans_to_reorder)
+ msg_Dbg(p_aout, "channel reordering needed for 7.1 / 8.0 output");
- chans_out[0] = AOUT_CHAN_LEFT;
- chans_out[1] = AOUT_CHAN_RIGHT;
- chans_out[2] = AOUT_CHAN_CENTER;
- chans_out[3] = AOUT_CHAN_LFE;
- chans_out[4] = AOUT_CHAN_MIDDLELEFT;
- chans_out[5] = AOUT_CHAN_MIDDLERIGHT;
- chans_out[6] = AOUT_CHAN_REARLEFT;
+ break;
+ case 9:
+ new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_DTS_8_1_B; // Lc C Rc L R Ls Cs Rs LFE
+ chans_out[0] = AOUT_CHAN_MIDDLELEFT;
+ chans_out[1] = AOUT_CHAN_CENTER;
+ chans_out[2] = AOUT_CHAN_MIDDLERIGHT;
+ chans_out[3] = AOUT_CHAN_LEFT;
+ chans_out[4] = AOUT_CHAN_RIGHT;
+ chans_out[5] = AOUT_CHAN_REARLEFT;
+ chans_out[6] = AOUT_CHAN_REARCENTER;
chans_out[7] = AOUT_CHAN_REARRIGHT;
+ chans_out[8] = AOUT_CHAN_LFE;
p_aout->sys->chans_to_reorder = aout_CheckChannelReorder(NULL, chans_out, fmt->i_physical_channels, p_aout->sys->chan_table);
if (p_aout->sys->chans_to_reorder)
- msg_Dbg(p_aout, "channel reordering needed for 7.1 output");
-
+ msg_Dbg(p_aout, "channel reordering needed for 8.1 output");
break;
}
More information about the vlc-commits
mailing list