diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/mp3data.c | 12 | ||||
-rw-r--r-- | firmware/pcm_playback.c | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/firmware/mp3data.c b/firmware/mp3data.c index 2b58710715..6e553eb94a 100644 --- a/firmware/mp3data.c +++ b/firmware/mp3data.c | |||
@@ -37,6 +37,11 @@ | |||
37 | #include "file.h" | 37 | #include "file.h" |
38 | #include "buffer.h" | 38 | #include "buffer.h" |
39 | 39 | ||
40 | #if defined(IRIVER_H100) && !defined(SIMULATOR) | ||
41 | #include "pcm_playback.h" | ||
42 | #include "kernel.h" | ||
43 | #endif | ||
44 | |||
40 | #define DEBUG_VERBOSE | 45 | #define DEBUG_VERBOSE |
41 | 46 | ||
42 | #define BYTES2INT(b1,b2,b3,b4) (((long)(b1 & 0xFF) << (3*8)) | \ | 47 | #define BYTES2INT(b1,b2,b3,b4) (((long)(b1 & 0xFF) << (3*8)) | \ |
@@ -259,6 +264,13 @@ static unsigned long __find_next_frame(int fd, long *offset, long max_offset, | |||
259 | 264 | ||
260 | static int fileread(int fd, unsigned char *c) | 265 | static int fileread(int fd, unsigned char *c) |
261 | { | 266 | { |
267 | #if defined(IRIVER_H100) && !defined(SIMULATOR) | ||
268 | /* We don't want to eat all cpu power. Maybe better way to do this | ||
269 | should be implemented. */ | ||
270 | while (pcm_is_lowdata()) | ||
271 | yield(); | ||
272 | #endif | ||
273 | |||
262 | return read(fd, c, 1); | 274 | return read(fd, c, 1); |
263 | } | 275 | } |
264 | 276 | ||
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c index 2c63f8ccd7..582f04cd72 100644 --- a/firmware/pcm_playback.c +++ b/firmware/pcm_playback.c | |||
@@ -44,7 +44,7 @@ | |||
44 | /* Must be a power of 2 */ | 44 | /* Must be a power of 2 */ |
45 | #define NUM_PCM_BUFFERS (PCMBUF_SIZE / CHUNK_SIZE) | 45 | #define NUM_PCM_BUFFERS (PCMBUF_SIZE / CHUNK_SIZE) |
46 | #define NUM_PCM_BUFFERS_MASK (NUM_PCM_BUFFERS - 1) | 46 | #define NUM_PCM_BUFFERS_MASK (NUM_PCM_BUFFERS - 1) |
47 | #define PCM_WATERMARK (CHUNK_SIZE * 3) | 47 | #define PCM_WATERMARK (CHUNK_SIZE * 6) |
48 | 48 | ||
49 | static bool pcm_playing; | 49 | static bool pcm_playing; |
50 | static bool pcm_paused; | 50 | static bool pcm_paused; |