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/pitch_detector.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps/plugins/pitch_detector.c') diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index c30d48a025..4ae43b3236 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c @@ -952,7 +952,7 @@ static uint32_t ICODE_ATTR buffer_magnitude(int16_t *input) } /* Stop the recording when the buffer is full */ -static void recording_callback(int status, void **start, size_t *size) +static void recording_callback(void **start, size_t *size) { int tail = audio_tail ^ 1; @@ -963,8 +963,6 @@ static void recording_callback(int status, void **start, size_t *size) /* Always record full buffer, even if not required */ *start = audio_data[tail]; *size = BUFFER_SIZE * sizeof (int16_t); - - (void)status; } #endif /* SIMULATOR */ @@ -973,7 +971,8 @@ static void record_data(void) { #ifndef SIMULATOR /* Always record full buffer, even if not required */ - rb->pcm_record_data(recording_callback, audio_data[audio_tail], + rb->pcm_record_data(recording_callback, NULL, + audio_data[audio_tail], BUFFER_SIZE * sizeof (int16_t)); #endif } -- cgit v1.2.3