From 7b03cd367dd5416a4728ccea7e47dcd2827cbab7 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 10 Jan 2023 18:59:21 +0100 Subject: 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. --- player/audio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'player') 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); -- cgit v1.2.3