Commit 3e3e5b51 authored by Felix Paul Kühne's avatar Felix Paul Kühne

auhal: add support for 8.0 and 8.1 output (close #8536)

parent 6424a7eb
......@@ -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,7 +626,8 @@ 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;
......@@ -614,12 +637,39 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
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 output");
msg_Dbg(p_aout, "channel reordering needed for 7.1 / 8.0 output");
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 8.1 output");
break;
}
/* Set up the format to be used */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment