[vlc-commits] auhal: fix compilation on 10. 6 and prevent attempts to set it up on those OS X versions (refs #8536)
Felix Paul Kühne
git at videolan.org
Tue Apr 30 15:18:57 CEST 2013
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Apr 30 15:18:16 2013 +0200| [762f742b394422ef7b5ee5a21808f7adcf685356] | committer: Felix Paul Kühne
auhal: fix compilation on 10.6 and prevent attempts to set it up on those OS X versions (refs #8536)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=762f742b394422ef7b5ee5a21808f7adcf685356
---
modules/audio_output/auhal.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index a40ef5e..9e3246e 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -394,6 +394,10 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
AURenderCallbackStruct input;
p_aout->sys->chans_to_reorder = 0;
+ SInt32 currentMinorSystemVersion;
+ if(Gestalt(gestaltSystemVersionMinor, ¤tMinorSystemVersion) != noErr)
+ msg_Err(p_aout, "failed to check OSX version");
+
/* Lets go find our Component */
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_HALOutput;
@@ -626,7 +630,7 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
break;
case 8:
- if (fmt->i_physical_channels & (AOUT_CHAN_LFE)) {
+ if (fmt->i_physical_channels & (AOUT_CHAN_LFE) || currentMinorSystemVersion < 7) {
new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A; // L R C LFE Ls Rs Lc Rc
chans_out[0] = AOUT_CHAN_LEFT;
@@ -637,7 +641,12 @@ 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 {
+
+ if (!(fmt->i_physical_channels & (AOUT_CHAN_LFE)))
+ msg_Warn(p_aout, "8.0 audio output not supported on OS X 10.%i, layout will be incorrect", currentMinorSystemVersion);
+ }
+#ifdef MAC_OS_X_VERSION_10_7
+ else {
new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_DTS_8_0_B; // Lc C Rc L R Ls Cs Rs
chans_out[0] = AOUT_CHAN_MIDDLELEFT;
@@ -649,12 +658,19 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
chans_out[6] = AOUT_CHAN_REARCENTER;
chans_out[7] = AOUT_CHAN_REARRIGHT;
}
+#endif
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");
break;
case 9:
+ if (currentMinorSystemVersion < 7) {
+ msg_Warn(p_aout, "8.1 audio output not supported on OS X 10.%i", currentMinorSystemVersion);
+ break;
+ }
+
+#ifdef MAC_OS_X_VERSION_10_7
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;
@@ -669,6 +685,7 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
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");
+#endif
break;
}
More information about the vlc-commits
mailing list