From 8c88d5c5e2fc0ea8656bfe0dd2a906a924a0c3d1 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Wed, 8 Dec 2021 21:44:12 -0500 Subject: [PATCH] playlist.c remove panic from OOM conditions the splash suffices as warning let the calling code decide what to do with it everything I saw calling expected failure with a -1 return so it shouldn't cause any issue removing the panic Change-Id: Idc1fba91c3ab4f1fd78e1d6a07dc2e6a0bfd8970 --- apps/playlist.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index 0d02be3d48..e93feb6abb 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -102,7 +102,6 @@ #include "rbunicode.h" #include "root_menu.h" #include "plugin.h" /* To borrow a temp buffer to rewrite a .m3u8 file */ -#include "panic.h" #include "logdiskf.h" #ifdef HAVE_DIRCACHE #include "dircache.h" @@ -2092,8 +2091,9 @@ int playlist_create(const char *dir, const char *file) } else { - /* should not happen */ - panicf("%s(): OOM", __func__); + /* should not happen -- happens if plugin takes audio buffer */ + splashf(HZ * 2, "%s(): OOM", __func__); + return -1; } } @@ -2127,7 +2127,10 @@ int playlist_resume(void) talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ handle = core_alloc_maximum("temp", &buflen, &dummy_ops); if (handle < 0) - panicf("%s(): OOM", __func__); + { + splashf(HZ * 2, "%s(): OOM", __func__); + return -1; + } buffer = core_get_data(handle); empty_playlist(playlist, true);