From 286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 23 Feb 2012 08:14:46 -0500 Subject: Revise the PCM callback system after adding multichannel audio. Additional status callback is added to pcm_play/rec_data instead of using a special function to set it. Status includes DMA error reporting to the status callback. Playback and recording callback become more alike except playback uses "const void **addr" (because the data should not be altered) and recording uses "void **addr". "const" is put in place throughout where appropriate. Most changes are fairly trivial. One that should be checked in particular because it isn't so much is telechips, if anyone cares to bother. PP5002 is not so trivial either but that tested as working. Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2 Reviewed-on: http://gerrit.rockbox.org/166 Reviewed-by: Michael Sevakis Tested-by: Michael Sevakis --- apps/plugins/pdbox/PDa/src/s_audio_rockbox.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'apps/plugins/pdbox') diff --git a/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c index 76a50fa075..6571f74edf 100644 --- a/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c +++ b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c @@ -26,7 +26,7 @@ #include "s_stuff.h" /* Declare functions that go to IRAM. */ -void pdbox_get_more(unsigned char** start, size_t* size) ICODE_ATTR; +void pdbox_get_more(const void** start, size_t* size) ICODE_ATTR; int rockbox_send_dacs(void) ICODE_ATTR; /* Extern variables. */ @@ -90,12 +90,12 @@ void rockbox_close_audio(void) } /* Rockbox audio callback. */ -void pdbox_get_more(unsigned char** start, size_t* size) +void pdbox_get_more(const void** start, size_t* size) { if(outbuf_fill > 0) { /* Store output data address and size. */ - *start = (unsigned char*) outbuf[outbuf_tail].data; + *start = outbuf[outbuf_tail].data; *size = sizeof(outbuf[outbuf_tail].data); /* Free this part of output buffer. */ @@ -116,8 +116,6 @@ void pdbox_get_more(unsigned char** start, size_t* size) playing = false; /* Nothing to play. */ - *start = NULL; - *size = 0; } } @@ -185,7 +183,7 @@ int rockbox_send_dacs(void) if(!playing && outbuf_fill > 0) { /* Start playing. */ - rb->pcm_play_data(pdbox_get_more, NULL, 0); + rb->pcm_play_data(pdbox_get_more, NULL, NULL, 0); /* Set status flag. */ playing = true; -- cgit v1.2.3