1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

ao_coreaudio: use default output unit when no device is specified

Using the default output audio unit should provide a much better user
exeperience since it changes automatically the output device based on which
becomes the default one.
This commit is contained in:
Stefano Pigozzi 2013-07-29 08:22:33 +02:00
parent 5f9aa74279
commit e777a86b69

View File

@ -363,7 +363,9 @@ static int init_lpcm(struct ao *ao, AudioStreamBasicDescription asbd)
AudioComponentDescription desc = (AudioComponentDescription) {
.componentType = kAudioUnitType_Output,
.componentSubType = kAudioUnitSubType_HALOutput,
.componentSubType = (p->opt_device_id < 0) ?
kAudioUnitSubType_DefaultOutput :
kAudioUnitSubType_HALOutput,
.componentManufacturer = kAudioUnitManufacturer_Apple,
.componentFlags = 0,
.componentFlagsMask = 0,