mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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:
parent
3f82f3aca1
commit
286a4c5caa
48 changed files with 799 additions and 752 deletions
|
@ -319,7 +319,7 @@ static inline void synthbuf(void)
|
|||
samples_in_buf = BUF_SIZE-i;
|
||||
}
|
||||
|
||||
static void get_more(unsigned char** start, size_t* size)
|
||||
static void get_more(const void** start, size_t* size)
|
||||
{
|
||||
#ifndef SYNC
|
||||
if(lastswap != swap)
|
||||
|
@ -333,10 +333,10 @@ static void get_more(unsigned char** start, size_t* size)
|
|||
|
||||
*size = samples_in_buf*sizeof(int32_t);
|
||||
#ifndef SYNC
|
||||
*start = (unsigned char*)((swap ? gmbuf : gmbuf + BUF_SIZE));
|
||||
*start = swap ? gmbuf : gmbuf + BUF_SIZE;
|
||||
swap = !swap;
|
||||
#else
|
||||
*start = (unsigned char*)(gmbuf);
|
||||
*start = gmbuf;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ static int midimain(const void * filename)
|
|||
samples_this_second = 0;
|
||||
|
||||
synthbuf();
|
||||
rb->pcm_play_data(&get_more, NULL, 0);
|
||||
rb->pcm_play_data(&get_more, NULL, NULL, 0);
|
||||
|
||||
while (!quit)
|
||||
{
|
||||
|
@ -445,7 +445,7 @@ static int midimain(const void * filename)
|
|||
seekBackward(5);
|
||||
midi_debug("Rewind to %d:%02d\n", playing_time/60, playing_time%60);
|
||||
if (is_playing)
|
||||
rb->pcm_play_data(&get_more, NULL, 0);
|
||||
rb->pcm_play_data(&get_more, NULL, NULL, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ static int midimain(const void * filename)
|
|||
seekForward(5);
|
||||
midi_debug("Skip to %d:%02d\n", playing_time/60, playing_time%60);
|
||||
if (is_playing)
|
||||
rb->pcm_play_data(&get_more, NULL, 0);
|
||||
rb->pcm_play_data(&get_more, NULL, NULL, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ static int midimain(const void * filename)
|
|||
{
|
||||
midi_debug("Playing from %d:%02d\n", playing_time/60, playing_time%60);
|
||||
is_playing = true;
|
||||
rb->pcm_play_data(&get_more, NULL, 0);
|
||||
rb->pcm_play_data(&get_more, NULL, NULL, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue