static int Probe ( aout_instance_t * );
static int DeviceDigitalMode ( aout_instance_t *, AudioDeviceID );
+int AudioDeviceHasOutput ( AudioDeviceID );
static int DigitalInit ( aout_instance_t * );
static OSStatus RenderCallbackAnalog ( vlc_object_t *, AudioUnitRenderActionFlags *, const AudioTimeStamp *,
return VLC_EGENERIC;
}
*/
+
if( AOUT_FMT_NON_LINEAR( &p_aout->output.output ) && p_sys->b_supports_digital )
{
p_sys->b_digital = VLC_TRUE;
char psz_devuid[1024];
char psz_name[1024];
CFStringRef devUID;
-
+
i_param_size = sizeof psz_name;
err = AudioDeviceGetProperty(
p_devices[i], 0, VLC_FALSE,
msg_Dbg( p_aout, "DevID: %lu DevName: %s DevUID: %s", p_devices[i], psz_name, psz_devuid );
CFRelease( devUID );
+ if( !AudioDeviceHasOutput(p_aout, p_devices[i]) )
+ {
+ msg_Dbg( p_aout, "this device is INPUT only. skipping..." );
+ continue;
+ }
+
val.i_int = (int) p_devices[i];
text.psz_string = psz_name;
var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
return VLC_EGENERIC;
}
+int AudioDeviceHasOutput( AudioDeviceID i_dev_id )
+{
+ UInt32 dataSize;
+ Boolean isWritable;
+
+ verify_noerr( AudioDeviceGetPropertyInfo( i_dev_id, 0, FALSE, kAudioDevicePropertyStreams, &dataSize, &isWritable) );
+ if (dataSize == 0) return FALSE;
+
+ return TRUE;
+}
+
/*****************************************************************************
* HardwareListener: Warns us of changes in the list of registered devices