mirror of https://github.com/mpv-player/mpv
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:
parent
7b9d726588
commit
e4b963e643
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue