summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/pcm-as3525.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-26 12:00:44 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-26 12:00:44 +0000
commitbdb8ba4ecdf459b3add14ba57a9ec942026d0be3 (patch)
treee7c20aef6fe60c30ce8c2a8c152b5fff645f6a18 /firmware/target/arm/as3525/pcm-as3525.c
parent65f4d393fd26cc1ed5f204352e5c1866288095da (diff)
as3525: implement pcm_play_dma_get_peak_buffer correctly
give the real amount of bytes left to transfer git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26311 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/pcm-as3525.c')
-rw-r--r--firmware/target/arm/as3525/pcm-as3525.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c
index 655c89021a..01d228f784 100644
--- a/firmware/target/arm/as3525/pcm-as3525.c
+++ b/firmware/target/arm/as3525/pcm-as3525.c
@@ -167,8 +167,11 @@ size_t pcm_get_bytes_waiting(void)
const void * pcm_play_dma_get_peak_buffer(int *count)
{
- *count = dma_size >> 2;
- return (const void*)dma_start_addr;
+ pcm_play_lock();
+ unsigned char *addr = (void*)DMAC_CH_SRC_ADDR(1);
+ *count = (dma_size - (addr - dma_start_addr)) >> 2;
+ pcm_play_unlock();
+ return AS3525_UNCACHED_ADDR(addr);
}
#ifdef HAVE_PCM_DMA_ADDRESS