summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-04-09 09:00:36 +0200
committerThomas Martitz <kugel@rockbox.org>2014-04-09 09:04:10 +0200
commit957613420e9c4906e8bb8ac685e10fc0c24329b8 (patch)
tree810061339f17dbe30759fc0acc7d04070ce2ed40 /apps/plugin.h
parent924a3c48d2b1a807bd7cd3b4b1e042fd2e3d7d06 (diff)
downloadrockbox-957613420e9c4906e8bb8ac685e10fc0c24329b8.tar.gz
rockbox-957613420e9c4906e8bb8ac685e10fc0c24329b8.zip
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
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h9
1 files changed, 2 insertions, 7 deletions
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);
160#define PLUGIN_MAGIC 0x526F634B /* RocK */ 160#define PLUGIN_MAGIC 0x526F634B /* RocK */
161 161
162/* increase this every time the api struct changes */ 162/* increase this every time the api struct changes */
163#define PLUGIN_API_VERSION 228 163#define PLUGIN_API_VERSION 229
164 164
165/* update this to latest version if a change to the api struct breaks 165/* update this to latest version if a change to the api struct breaks
166 backwards compatibility (and please take the opportunity to sort in any 166 backwards compatibility (and please take the opportunity to sort in any
@@ -976,6 +976,7 @@ struct plugin_api {
976 976
977 /* new stuff at the end, sort into place next time 977 /* new stuff at the end, sort into place next time
978 the API gets incompatible */ 978 the API gets incompatible */
979 void (*plugin_release_audio_buffer)(void);
979}; 980};
980 981
981/* plugin header */ 982/* plugin header */
@@ -1006,12 +1007,6 @@ extern unsigned char plugin_end_addr[];
1006#endif /* PLUGIN */ 1007#endif /* PLUGIN */
1007 1008
1008int plugin_load(const char* plugin, const void* parameter); 1009int plugin_load(const char* plugin, const void* parameter);
1009void* plugin_get_audio_buffer(size_t *buffer_size);
1010
1011/* plugin_tsr,
1012 callback returns true to allow the new plugin to load,
1013 reenter means the currently running plugin is being reloaded */
1014void plugin_tsr(bool (*exit_callback)(bool reenter));
1015 1010
1016/* defined by the plugin */ 1011/* defined by the plugin */
1017extern const struct plugin_api *rb; 1012extern const struct plugin_api *rb;