diff options
author | sfan5 <sfan5@live.de> | 2023-01-10 18:59:21 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-01-12 22:02:07 +0100 |
commit | 7b03cd367dd5416a4728ccea7e47dcd2827cbab7 (patch) | |
tree | cea4075b81850000890f55d6cd01de117a2138a0 /player/audio.c | |
parent | b6b83805183618f3a46f2cc77d85dcff72ef6396 (diff) | |
download | mpv-7b03cd367dd5416a4728ccea7e47dcd2827cbab7.tar.bz2 mpv-7b03cd367dd5416a4728ccea7e47dcd2827cbab7.tar.xz |
various: replace if + abort() with MP_HANDLE_OOM()
MP_HANDLE_OOM also aborts but calls assert() first, which
will result in an useful message if compiled in debug mode.
Diffstat (limited to 'player/audio.c')
-rw-r--r-- | player/audio.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/player/audio.c b/player/audio.c index 40a6a3a32a..0e48731e33 100644 --- a/player/audio.c +++ b/player/audio.c @@ -313,8 +313,7 @@ static bool keep_weak_gapless_format(struct mp_aframe *old, struct mp_aframe* ne { bool res = false; struct mp_aframe *new_mod = mp_aframe_new_ref(new); - if (!new_mod) - abort(); + MP_HANDLE_OOM(new_mod); // If the sample formats are compatible (== libswresample generally can // convert them), keep the AO. On other changes, recreate it. @@ -366,8 +365,7 @@ static int reinit_audio_filters_and_output(struct MPContext *mpctx) // The "ideal" filter output format struct mp_aframe *out_fmt = mp_aframe_new_ref(ao_c->filter->output_aformat); - if (!out_fmt) - abort(); + MP_HANDLE_OOM(out_fmt); if (!mp_aframe_config_is_valid(out_fmt)) { talloc_free(out_fmt); |