From 2f8eabe2166f897b9290ff154c882e87fee16746 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 29 Jun 2015 23:59:41 +0200 Subject: ao_coreaudio: restore physical format if it can't be set exactly May help with (supposedly) bad drivers, which can put the device into some sort of broken state when trying to set a different physical format. When the previous format is restored, it apparently recovers. This might make the change-physical-format suboption more robust. --- audio/out/ao_coreaudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'audio/out/ao_coreaudio.c') diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index b39cebc2e4..8fba7a944c 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -235,7 +235,8 @@ static void init_physical_format(struct ao *ao) &p->original_asbd); CHECK_CA_WARN("could not get current physical stream format"); - ca_change_physical_format_sync(ao, streams[i], best_asbd); + if (!ca_change_physical_format_sync(ao, streams[i], best_asbd)) + p->original_asbd = (AudioStreamBasicDescription){0}; break; } } -- cgit v1.2.3