summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c')
-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;