1
0
Fork 0
forked from len0rd/rockbox

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 <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
This commit is contained in:
Michael Sevakis 2012-02-23 08:14:46 -05:00
parent 3f82f3aca1
commit 286a4c5caa
48 changed files with 799 additions and 752 deletions

View file

@ -90,13 +90,13 @@ static int16_t ICODE_ATTR fsin(uint32_t phase)
}
/* ISR handler to get next block of data */
static void get_more(unsigned char **start, size_t *size)
static void get_more(const void **start, size_t *size)
{
/* Free previous buffer */
output_head += output_step;
output_step = 0;
*start = (unsigned char *)output_buf[output_head & OUTPUT_CHUNK_MASK];
*start = output_buf[output_head & OUTPUT_CHUNK_MASK];
*size = OUTPUT_CHUNK_SIZE;
/* Keep repeating previous if source runs low */
@ -236,7 +236,7 @@ static void play_tone(bool volume_set)
IF_PRIO(, PRIORITY_PLAYBACK)
IF_COP(, CPU));
rb->pcm_play_data(get_more, NULL, 0);
rb->pcm_play_data(get_more, NULL, NULL, 0);
#ifndef HAVE_VOLUME_IN_LIST
if (volume_set)