summaryrefslogtreecommitdiff
path: root/firmware/target/mips
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-07-27 17:00:26 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-07-27 17:00:26 +0000
commit86ef57b9757c7cc23951040c5c46966728eeb8fa (patch)
treede0b8866e6681688a6ecfb9dd1063243d1e124e8 /firmware/target/mips
parent8ef07c8a2f43f3efb4993446a122e32f4ae23efc (diff)
Jz4740 PCM driver: check whether pcm_callback_for_more isn't NULL (fixes metronome)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22072 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c b/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
index 1fbc94065b..32a14744df 100644
--- a/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
@@ -81,11 +81,13 @@ static inline void set_dma(const void *addr, size_t size)
static inline void play_dma_callback(void)
{
- unsigned char *start;
+ unsigned char *start = NULL;
size_t size = 0;
- pcm_callback_for_more(&start, &size);
- if(LIKELY(size > 0))
+ if(pcm_callback_for_more)
+ pcm_callback_for_more(&start, &size);
+
+ if(LIKELY(size > 0 && start))
{
set_dma(start, size);
REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) |= DMAC_DCCSR_EN;