ao_coreaudio_exclusive: continue even if setting physical format fails

Makes it work with (apparently) crappy drivers, which refuse to set the
physical format in some cases.
This commit is contained in:
wm4 2015-07-06 00:04:20 +02:00
parent 7b9d726588
commit e4b963e643
2 changed files with 4 additions and 2 deletions

View File

@ -288,8 +288,9 @@ static int init(struct ao *ao)
&p->original_asbd);
CHECK_CA_ERROR("could not get stream's original physical format");
if (!ca_change_physical_format_sync(ao, p->stream, hwfmt))
goto coreaudio_error;
// Even if changing the physical format fails, we can try using the current
// virtual format.
ca_change_physical_format_sync(ao, p->stream, hwfmt);
if (!ca_init_chmap(ao, p->device))
goto coreaudio_error;

View File

@ -514,6 +514,7 @@ bool ca_change_physical_format_sync(struct ao *ao, AudioStreamID stream,
ca_print_asbd(ao, "actual format in use:", &actual_format);
if (!format_set) {
MP_WARN(ao, "changing physical format failed\n");
// Some drivers just fuck up and get into a broken state. Restore the
// old format in this case.
err = CA_SET(stream, kAudioStreamPropertyPhysicalFormat, &prev_format);