diff options
author | sfan5 <sfan5@live.de> | 2023-11-23 20:46:25 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-11-24 10:04:55 +0100 |
commit | aa362fdcf440fb747c3aeb377ce51d91cc05f38b (patch) | |
tree | 3a363fc3e2d4d52d1a02382e5d815be2aba455a7 /audio/out/ao_coreaudio_utils.c | |
parent | e22a2f04833852ce825eb7c1235d9bdaaa9b2397 (diff) | |
download | mpv-aa362fdcf440fb747c3aeb377ce51d91cc05f38b.tar.bz2 mpv-aa362fdcf440fb747c3aeb377ce51d91cc05f38b.tar.xz |
various: replace some OOM handling
We prefer to fail fast rather than degrade in unpredictable ways.
The example in sub/ is particularly egregious because the code just
skips the work it's meant to do when an allocation fails.
Diffstat (limited to 'audio/out/ao_coreaudio_utils.c')
-rw-r--r-- | audio/out/ao_coreaudio_utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index 978165d652..f730beca87 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -471,10 +471,8 @@ bool ca_change_physical_format_sync(struct ao *ao, AudioStreamID stream, ca_print_asbd(ao, "setting stream physical format:", &change_format); mp_sem_t wakeup; - if (mp_sem_init(&wakeup, 0, 0)) { - MP_WARN(ao, "OOM\n"); - return false; - } + if (mp_sem_init(&wakeup, 0, 0)) + MP_HANDLE_OOM(0); AudioStreamBasicDescription prev_format; err = CA_GET(stream, kAudioStreamPropertyPhysicalFormat, &prev_format); |