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:
sfan5
2023-11-23 20:46:25 +01:00
parent e22a2f0483
commit aa362fdcf4
4 changed files with 6 additions and 9 deletions

View File

@@ -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);