summaryrefslogtreecommitdiff
path: root/apps/recorder/pcm_record.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/recorder/pcm_record.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/recorder/pcm_record.c')
-rw-r--r--apps/recorder/pcm_record.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c
index ef10f8a433..0f6e8469ec 100644
--- a/apps/recorder/pcm_record.c
+++ b/apps/recorder/pcm_record.c
@@ -1406,12 +1406,9 @@ static int pcmrec_handle;
1406static void on_init_recording(void) 1406static void on_init_recording(void)
1407{ 1407{
1408 send_event(RECORDING_EVENT_START, NULL); 1408 send_event(RECORDING_EVENT_START, NULL);
1409 /* dummy ops with no callbacks, needed because by 1409 /* FIXME: This buffer should play nicer and be shrinkable/movable */
1410 * default buflib buffers can be moved around which must be avoided
1411 * FIXME: This buffer should play nicer and be shrinkable/movable */
1412 static struct buflib_callbacks dummy_ops;
1413 talk_buffer_set_policy(TALK_BUFFER_LOOSE); 1410 talk_buffer_set_policy(TALK_BUFFER_LOOSE);
1414 pcmrec_handle = core_alloc_maximum("pcmrec", &rec_buffer_size, &dummy_ops); 1411 pcmrec_handle = core_alloc_maximum("pcmrec", &rec_buffer_size, &buflib_ops_locked);
1415 if (pcmrec_handle <= 0) 1412 if (pcmrec_handle <= 0)
1416 /* someone is abusing core_alloc_maximum(). Fix this evil guy instead of 1413 /* someone is abusing core_alloc_maximum(). Fix this evil guy instead of
1417 * trying to handle OOM without hope */ 1414 * trying to handle OOM without hope */