summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-12-08 21:44:12 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2021-12-08 21:44:12 -0500
commit8c88d5c5e2fc0ea8656bfe0dd2a906a924a0c3d1 (patch)
tree62cedc69c507e18bd935bb497920c41c8107b1f2
parent221e8752cce3509660abe8848f731062ae2ceb81 (diff)
downloadrockbox-8c88d5c5e2fc0ea8656bfe0dd2a906a924a0c3d1.tar.gz
rockbox-8c88d5c5e2fc0ea8656bfe0dd2a906a924a0c3d1.zip
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
-rw-r--r--apps/playlist.c11
1 files 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 @@
102#include "rbunicode.h" 102#include "rbunicode.h"
103#include "root_menu.h" 103#include "root_menu.h"
104#include "plugin.h" /* To borrow a temp buffer to rewrite a .m3u8 file */ 104#include "plugin.h" /* To borrow a temp buffer to rewrite a .m3u8 file */
105#include "panic.h"
106#include "logdiskf.h" 105#include "logdiskf.h"
107#ifdef HAVE_DIRCACHE 106#ifdef HAVE_DIRCACHE
108#include "dircache.h" 107#include "dircache.h"
@@ -2092,8 +2091,9 @@ int playlist_create(const char *dir, const char *file)
2092 } 2091 }
2093 else 2092 else
2094 { 2093 {
2095 /* should not happen */ 2094 /* should not happen -- happens if plugin takes audio buffer */
2096 panicf("%s(): OOM", __func__); 2095 splashf(HZ * 2, "%s(): OOM", __func__);
2096 return -1;
2097 } 2097 }
2098 } 2098 }
2099 2099
@@ -2127,7 +2127,10 @@ int playlist_resume(void)
2127 talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ 2127 talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */
2128 handle = core_alloc_maximum("temp", &buflen, &dummy_ops); 2128 handle = core_alloc_maximum("temp", &buflen, &dummy_ops);
2129 if (handle < 0) 2129 if (handle < 0)
2130 panicf("%s(): OOM", __func__); 2130 {
2131 splashf(HZ * 2, "%s(): OOM", __func__);
2132 return -1;
2133 }
2131 buffer = core_get_data(handle); 2134 buffer = core_get_data(handle);
2132 2135
2133 empty_playlist(playlist, true); 2136 empty_playlist(playlist, true);