From e777a86b69c9f83766f165b2bf6f05a83eb82605 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 29 Jul 2013 08:22:33 +0200 Subject: 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. --- audio/out/ao_coreaudio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 62fe630acd..2f5dddba44 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -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, -- cgit v1.2.3