forked from len0rd/rockbox
Better handling for cpu_boost(). Small buffering fix.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6647 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b945fe84aa
commit
2ed0b195be
3 changed files with 28 additions and 20 deletions
|
|
@ -99,15 +99,6 @@ static void dma_start(const void *addr, long size)
|
|||
DCR0 = DMA_INT | DMA_EEXT | DMA_CS | DMA_SINC | DMA_START;
|
||||
}
|
||||
|
||||
/* Stops the DMA transfer and interrupt */
|
||||
static void dma_stop(void)
|
||||
{
|
||||
pcm_playing = false;
|
||||
|
||||
/* Reset the FIFO */
|
||||
IIS2CONFIG = 0x800;
|
||||
}
|
||||
|
||||
void pcm_boost(bool state)
|
||||
{
|
||||
static bool boost_state = false;
|
||||
|
|
@ -121,6 +112,16 @@ void pcm_boost(bool state)
|
|||
}
|
||||
}
|
||||
|
||||
/* Stops the DMA transfer and interrupt */
|
||||
static void dma_stop(void)
|
||||
{
|
||||
pcm_playing = false;
|
||||
|
||||
/* Reset the FIFO */
|
||||
IIS2CONFIG = 0x800;
|
||||
pcm_boost(false);
|
||||
}
|
||||
|
||||
/* set volume of the main channel */
|
||||
void pcm_set_volume(int volume)
|
||||
{
|
||||
|
|
@ -385,6 +386,7 @@ bool pcm_is_lowdata(void)
|
|||
|
||||
void pcm_crossfade_start(void)
|
||||
{
|
||||
//logf("cf:%d", audiobuffer_free / CHUNK_SIZE);
|
||||
if (audiobuffer_free > CHUNK_SIZE * 4 || !crossfade_enabled) {
|
||||
return ;
|
||||
}
|
||||
|
|
@ -493,6 +495,7 @@ void pcm_play_init(void)
|
|||
pcmbuf_read_index = 0;
|
||||
pcmbuf_write_index = 0;
|
||||
pcmbuf_unplayed_bytes = 0;
|
||||
crossfade_enabled = false;
|
||||
pcm_play_set_watermark(PCM_WATERMARK, pcm_watermark_callback);
|
||||
|
||||
/* Play a small chunk of zeroes to initialize the playback system. */
|
||||
|
|
@ -501,9 +504,7 @@ void pcm_play_init(void)
|
|||
memset(&audiobuffer[0], 0, audiobuffer_pos);
|
||||
pcm_play_add_chunk(&audiobuffer[0], audiobuffer_pos, NULL);
|
||||
pcm_play_start();
|
||||
cpu_boost(false);
|
||||
|
||||
crossfade_enabled = false;
|
||||
}
|
||||
|
||||
void pcm_crossfade_enable(bool on_off)
|
||||
|
|
@ -511,6 +512,11 @@ void pcm_crossfade_enable(bool on_off)
|
|||
crossfade_enabled = on_off;
|
||||
}
|
||||
|
||||
bool pcm_is_crossfade_enabled(void)
|
||||
{
|
||||
return crossfade_enabled;
|
||||
}
|
||||
|
||||
void pcm_play_start(void)
|
||||
{
|
||||
struct pcmbufdesc *desc = &pcmbuffers[pcmbuf_read_index];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue