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/zxbox/spsound.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'apps/plugins/zxbox') diff --git a/apps/plugins/zxbox/spsound.c b/apps/plugins/zxbox/spsound.c index 8b3aa3d84f..9d3eefa87f 100644 --- a/apps/plugins/zxbox/spsound.c +++ b/apps/plugins/zxbox/spsound.c @@ -189,12 +189,11 @@ void autoclose_sound(void) } #endif } -static void get_more(unsigned char** start, size_t* size) +static void get_more(const void** start, size_t* size) { doneplay = 1; - rb->pcm_play_stop(); - (void)*start; - (void)*size; + (void)start; + (void)size; } /* sp_sound_buf is Unsigned 8 bit, Rate 8000 Hz, Mono */ @@ -219,7 +218,7 @@ static void write_buf(void){ = my_buf[j+10] = my_buf[j+11] \ = (((byte)sp_sound_buf[i])<<8) >> settings.volume; - rb->pcm_play_data(&get_more,(unsigned char*)(my_buf),TMNUM*4*3*2); + rb->pcm_play_data(&get_more,NULL,(unsigned char*)(my_buf),TMNUM*4*3*2); #if 0 /* can use to save and later analyze what we produce */ -- cgit v1.2.3