diff options
author | wm4 <wm4@nowhere> | 2015-07-06 00:04:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-07-06 00:04:20 +0200 |
commit | e4b963e643b93474d21e16b50c1e9fcf40bddcae (patch) | |
tree | b53b04953c14f7065bee213066f9c64e3c78dbbd /audio | |
parent | 7b9d72658898574f4b001bcc496bf3532d4b3cc5 (diff) | |
download | mpv-e4b963e643b93474d21e16b50c1e9fcf40bddcae.tar.bz2 mpv-e4b963e643b93474d21e16b50c1e9fcf40bddcae.tar.xz |
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.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_coreaudio_exclusive.c | 5 | ||||
-rw-r--r-- | audio/out/ao_coreaudio_utils.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c index 015bcf7764..031bc67b9e 100644 --- a/audio/out/ao_coreaudio_exclusive.c +++ b/audio/out/ao_coreaudio_exclusive.c @@ -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; diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index e1c61276b9..2c3a5b4c50 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -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); |