diff options
Diffstat (limited to 'firmware/target/arm/pnx0101')
-rw-r--r-- | firmware/target/arm/pnx0101/pcm-pnx0101.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/target/arm/pnx0101/pcm-pnx0101.c b/firmware/target/arm/pnx0101/pcm-pnx0101.c index 9d4ffbd773..d4c17454ed 100644 --- a/firmware/target/arm/pnx0101/pcm-pnx0101.c +++ b/firmware/target/arm/pnx0101/pcm-pnx0101.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "system.h" | 21 | #include "system.h" |
22 | #include "audio.h" | 22 | #include "audio.h" |
23 | #include "string.h" | 23 | #include "string.h" |
24 | #include "pcm-internal.h" | ||
24 | 25 | ||
25 | #define DMA_BUF_SAMPLES 0x100 | 26 | #define DMA_BUF_SAMPLES 0x100 |
26 | 27 | ||
@@ -63,6 +64,8 @@ static inline void fill_dma_buf(int offset) | |||
63 | 64 | ||
64 | if (pcm_playing && !pcm_paused) | 65 | if (pcm_playing && !pcm_paused) |
65 | { | 66 | { |
67 | bool new_buffer =false; | ||
68 | |||
66 | do | 69 | do |
67 | { | 70 | { |
68 | int count; | 71 | int count; |
@@ -102,10 +105,20 @@ static inline void fill_dma_buf(int offset) | |||
102 | count--; | 105 | count--; |
103 | } | 106 | } |
104 | p = tmp_p; | 107 | p = tmp_p; |
108 | |||
109 | if (new_buffer) | ||
110 | { | ||
111 | new_buffer = false; | ||
112 | pcm_play_dma_started_callback(); | ||
113 | } | ||
114 | |||
105 | if (l >= lend) | 115 | if (l >= lend) |
106 | return; | 116 | return; |
107 | 117 | ||
108 | pcm_play_get_more_callback((void**)&p, &p_size); | 118 | pcm_play_get_more_callback((void**)&p, &p_size); |
119 | |||
120 | if (p_size) | ||
121 | new_buffer = true; | ||
109 | } | 122 | } |
110 | while (p_size); | 123 | while (p_size); |
111 | } | 124 | } |