summaryrefslogtreecommitdiff
path: root/apps/plugin.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-01-18 18:57:06 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-02-12 10:24:32 -0500
commite8faf2f2adeb9066de3c968a57803bb262f61ee1 (patch)
tree130c2e3d904da7876ac88ea089f85f48cab5e313 /apps/plugin.c
parent95dfc489b5a602f68202b206c434f8485e9d3915 (diff)
downloadrockbox-e8faf2f2adeb9066de3c968a57803bb262f61ee1.tar.gz
rockbox-e8faf2f2adeb9066de3c968a57803bb262f61ee1.zip
buflib: add a common dummy callbacks struct & use it
There are various allocations that can't be moved or shrunk. Provide a global callback struct for this use case instead of making each caller declare its own dummy struct. Also fixed ROLO and x1000 installer code which incorrectly used movable allocations. Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
Diffstat (limited to 'apps/plugin.c')
-rw-r--r--apps/plugin.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index aa69b9ca03..8434fea07d 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -990,14 +990,11 @@ void* plugin_get_buffer(size_t *buffer_size)
990 */ 990 */
991static void* plugin_get_audio_buffer(size_t *buffer_size) 991static void* plugin_get_audio_buffer(size_t *buffer_size)
992{ 992{
993 /* dummy ops with no callbacks, needed because by
994 * default buflib buffers can be moved around which must be avoided */
995 static struct buflib_callbacks dummy_ops;
996 if (plugin_buffer_handle <= 0) 993 if (plugin_buffer_handle <= 0)
997 { 994 {
998 plugin_buffer_handle = core_alloc_maximum("plugin audio buf", 995 plugin_buffer_handle = core_alloc_maximum("plugin audio buf",
999 &plugin_buffer_size, 996 &plugin_buffer_size,
1000 &dummy_ops); 997 &buflib_ops_locked);
1001 } 998 }
1002 999
1003 if (buffer_size) 1000 if (buffer_size)