Commit 99ccd646 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Auhal: simplifications

parent cd34d65e
...@@ -82,7 +82,6 @@ struct aout_sys_t ...@@ -82,7 +82,6 @@ struct aout_sys_t
AudioDeviceID i_selected_dev; /* DeviceID of the selected device */ AudioDeviceID i_selected_dev; /* DeviceID of the selected device */
AudioDeviceIOProcID i_procID; /* DeviceID of current device */ AudioDeviceIOProcID i_procID; /* DeviceID of current device */
UInt32 i_devices; /* Number of CoreAudio Devices */ UInt32 i_devices; /* Number of CoreAudio Devices */
bool b_supports_digital; /* Does the currently selected device support digital mode? */
bool b_digital; /* Are we running in digital mode? */ bool b_digital; /* Are we running in digital mode? */
mtime_t clock_diff; /* Difference between VLC clock and Device clock */ mtime_t clock_diff; /* Difference between VLC clock and Device clock */
...@@ -170,7 +169,6 @@ static int Open( vlc_object_t * p_this ) ...@@ -170,7 +169,6 @@ static int Open( vlc_object_t * p_this )
p_sys->i_default_dev = 0; p_sys->i_default_dev = 0;
p_sys->i_selected_dev = 0; p_sys->i_selected_dev = 0;
p_sys->i_devices = 0; p_sys->i_devices = 0;
p_sys->b_supports_digital = false;
p_sys->b_digital = false; p_sys->b_digital = false;
p_sys->au_component = NULL; p_sys->au_component = NULL;
p_sys->au_unit = NULL; p_sys->au_unit = NULL;
...@@ -210,11 +208,9 @@ static int Open( vlc_object_t * p_this ) ...@@ -210,11 +208,9 @@ static int Open( vlc_object_t * p_this )
} }
p_sys->i_selected_dev = val.i_int & ~AOUT_VAR_SPDIF_FLAG; /* remove SPDIF flag to get the true DeviceID */ p_sys->i_selected_dev = val.i_int & ~AOUT_VAR_SPDIF_FLAG; /* remove SPDIF flag to get the true DeviceID */
p_sys->b_supports_digital = ( val.i_int & AOUT_VAR_SPDIF_FLAG ) ? true : false; bool b_supports_digital = ( val.i_int & AOUT_VAR_SPDIF_FLAG );
if( p_sys->b_supports_digital ) if( b_supports_digital )
msg_Dbg( p_aout, "audio device supports digital output" ); msg_Dbg( p_aout, "audio device supports digital output" );
else
msg_Dbg( p_aout, "audio device does not support digital output" );
/* Check if the desired device is alive and usable */ /* Check if the desired device is alive and usable */
/* TODO: add a callback to the device to alert us if the device dies */ /* TODO: add a callback to the device to alert us if the device dies */
...@@ -261,7 +257,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -261,7 +257,7 @@ static int Open( vlc_object_t * p_this )
} }
/* Check for Digital mode or Analog output mode */ /* Check for Digital mode or Analog output mode */
if( AOUT_FMT_SPDIF( &p_aout->format ) && p_sys->b_supports_digital ) if( AOUT_FMT_SPDIF( &p_aout->format ) && b_supports_digital )
{ {
if( OpenSPDIF( p_aout ) ) if( OpenSPDIF( p_aout ) )
{ {
...@@ -1417,7 +1413,7 @@ static OSStatus StreamListener( AudioObjectID inObjectID, UInt32 inNumberAddres ...@@ -1417,7 +1413,7 @@ static OSStatus StreamListener( AudioObjectID inObjectID, UInt32 inNumberAddres
VLC_UNUSED(inObjectID); VLC_UNUSED(inObjectID);
for ( unsigned int i = 0; i < inNumberAddresses; i++ ) for( unsigned int i = 0; i < inNumberAddresses; i++ )
{ {
if( inAddresses[i].mSelector == kAudioStreamPropertyPhysicalFormat ) if( inAddresses[i].mSelector == kAudioStreamPropertyPhysicalFormat )
{ {
......
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