From 957613420e9c4906e8bb8ac685e10fc0c24329b8 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 9 Apr 2014 09:00:36 +0200 Subject: plugins: Add plugin_release_audio_buffer(). Some plugins grab the whole audio buffer and still want to start playback somehow (e.g. random_folder_advance_config). Since 22e802e the plugin buffer is allocated via buflib and has to be released explicitely. For these plugins the automatic free on exit is not sufficient and they need an API function for that. Fixes OOM panic on random_folder_advance_config when using start shuffled playback. Change-Id: I0d351daa782cb829f4ff80d34c05f40a2e0c142f --- apps/plugin.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'apps/plugin.h') diff --git a/apps/plugin.h b/apps/plugin.h index 874f6e0069..6a15f86919 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -160,7 +160,7 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 228 +#define PLUGIN_API_VERSION 229 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any @@ -976,6 +976,7 @@ struct plugin_api { /* new stuff at the end, sort into place next time the API gets incompatible */ + void (*plugin_release_audio_buffer)(void); }; /* plugin header */ @@ -1006,12 +1007,6 @@ extern unsigned char plugin_end_addr[]; #endif /* PLUGIN */ int plugin_load(const char* plugin, const void* parameter); -void* plugin_get_audio_buffer(size_t *buffer_size); - -/* plugin_tsr, - callback returns true to allow the new plugin to load, - reenter means the currently running plugin is being reloaded */ -void plugin_tsr(bool (*exit_callback)(bool reenter)); /* defined by the plugin */ extern const struct plugin_api *rb; -- cgit v1.2.3