[vlc-commits] Revert "auhal: implement channel re-ordering for 6.1 and 7.1 setups ( close #7783)"
Felix Paul Kühne
git at videolan.org
Fri Jan 25 13:40:06 CET 2013
vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jan 25 13:37:05 2013 +0100| [df258830cdfde84b1e9a1bbe1f87a70b39e85e16] | committer: Felix Paul Kühne
Revert "auhal: implement channel re-ordering for 6.1 and 7.1 setups (close #7783)"
This reverts commit c8afad0f2771969ba1678d2818a92d67a40ac859.
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=df258830cdfde84b1e9a1bbe1f87a70b39e85e16
---
NEWS | 1 -
modules/audio_output/auhal.c | 58 +++++++-----------------------------------
2 files changed, 9 insertions(+), 50 deletions(-)
diff --git a/NEWS b/NEWS
index 74f8c80..e7bf1f5 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,6 @@ Decoders:
* Fix GPU decoding on Intel HD 2000/3000 cards on Windows
Mac OS X:
- * Fix speaker layout for 6.1 and 7.1 audio playback
* Fix subtitle rendering resolution when using OS X's native fullscreen mode
* Improve fullscreen controller time slider with larger click target
* Fix listing of the lua interfaces (web, telnet and console)
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index f2a2390..2a73ebf 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -79,9 +79,6 @@ struct aout_sys_t
bool b_digital; /* Are we running in digital mode? */
mtime_t clock_diff; /* Difference between VLC clock and Device clock */
- uint8_t chans_to_reorder; /* do we need channel reordering */
- uint8_t chan_table[AOUT_CHAN_MAX];
-
/* AUHAL specific */
Component au_component; /* The Audiocomponent we use */
AudioUnit au_unit; /* The AudioUnit we use */
@@ -470,10 +467,8 @@ static int OpenAnalog( audio_output_t *p_aout )
msg_Dbg( p_aout, "VLC will output: %s", aout_FormatPrintChannels( &p_aout->format ));
memset (&new_layout, 0, sizeof(new_layout));
-
- uint32_t chans_out[AOUT_CHAN_MAX];
-
- switch(aout_FormatNbChannels(fmt)) {
+ switch( aout_FormatNbChannels( &p_aout->format ) )
+ {
case 1:
new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_Mono;
break;
@@ -525,37 +520,12 @@ static int OpenAnalog( audio_output_t *p_aout )
}
break;
case 7:
- new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A;
-
- 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_REARLEFT;
- chans_out[5] = AOUT_CHAN_REARRIGHT;
- chans_out[6] = AOUT_CHAN_REARCENTER;
-
- 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" );
-
+ /* FIXME: This is incorrect. VLC uses the internal ordering: L R Lm Rm Lr Rr C LFE but this is wrong */
+ new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A; // L R C LFE Ls Rs Cs
break;
case 8:
- new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A;
-
- 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;
-
- 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" );
-
+ /* FIXME: This is incorrect. VLC uses the internal ordering: L R Lm Rm Lr Rr C LFE but this is wrong */
+ new_layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A; // L R C LFE Ls Rs Lc Rc
break;
}
@@ -620,8 +590,8 @@ static int OpenAnalog( audio_output_t *p_aout )
/* Set the new_layout as the layout VLC will use to feed the AU unit */
verify_noerr( AudioUnitSetProperty( p_sys->au_unit,
kAudioUnitProperty_AudioChannelLayout,
- kAudioUnitScope_Output,
- 0, &new_layout, sizeof(new_layout)));
+ kAudioUnitScope_Input,
+ 0, &new_layout, sizeof(new_layout) ) );
if( new_layout.mNumberChannelDescriptions > 0 )
free( new_layout.mChannelDescriptions );
@@ -1374,17 +1344,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
if( p_buffer != NULL )
{
- /* Do the channel reordering */
- if (p_buffer && p_sys->chans_to_reorder)
- {
- aout_ChannelReorder(p_buffer->p_buffer,
- p_buffer->i_buffer,
- p_sys->chans_to_reorder,
- p_sys->chan_table,
- 32);
- }
-
- uint32_t i_second_mData_bytes = __MIN(p_buffer->i_buffer, ioData->mBuffers[0].mDataByteSize - i_mData_bytes);
+ uint32_t i_second_mData_bytes = __MIN( p_buffer->i_buffer, ioData->mBuffers[0].mDataByteSize - i_mData_bytes );
vlc_memcpy( (uint8_t *)ioData->mBuffers[0].mData + i_mData_bytes,
p_buffer->p_buffer, i_second_mData_bytes );
More information about the vlc-commits
mailing list