mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user