summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-06-12 15:14:20 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-06-12 15:14:20 +0000
commit097444d07cf394919d7eba149dfe81161cd86453 (patch)
tree138b463dc08ad23a13f46223b2d79e93327c3a77
parent7cdae1ac657e3fe6ffc01bf9b3536d2cc1638fed (diff)
Fixed some mp3 metadata reading performance problem. Next track
switching should be more reliable. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6691 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c4
-rw-r--r--firmware/mp3data.c12
-rw-r--r--firmware/pcm_playback.c2
3 files changed, 15 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 0bd0c27c03..391f5e9537 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -666,7 +666,7 @@ bool audio_load_track(int offset, bool start_play, int peek_offset)
mp3info(&tracks[track_widx].id3, trackname, v1first);
lseek(fd, 0, SEEK_SET);
/* This is too slow to execute on some files. */
- // get_mp3file_info(fd, &tracks[track_widx].mp3data);
+ get_mp3file_info(fd, &tracks[track_widx].mp3data);
if (offset) {
lseek(fd, offset, SEEK_SET);
tracks[track_widx].id3.offset = offset;
@@ -1272,7 +1272,7 @@ void codec_thread(void)
case CODEC_LOAD:
if (status != PLUGIN_OK) {
logf("Codec failure");
- playing = false;
+ // playing = false;
} else {
logf("Codec finished");
}
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 @@
#include "file.h"
#include "buffer.h"
+#if defined(IRIVER_H100) && !defined(SIMULATOR)
+#include "pcm_playback.h"
+#include "kernel.h"
+#endif
+
#define DEBUG_VERBOSE
#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,
static int fileread(int fd, unsigned char *c)
{
+#if defined(IRIVER_H100) && !defined(SIMULATOR)
+ /* We don't want to eat all cpu power. Maybe better way to do this
+ should be implemented. */
+ while (pcm_is_lowdata())
+ yield();
+#endif
+
return read(fd, c, 1);
}
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 @@
/* Must be a power of 2 */
#define NUM_PCM_BUFFERS (PCMBUF_SIZE / CHUNK_SIZE)
#define NUM_PCM_BUFFERS_MASK (NUM_PCM_BUFFERS - 1)
-#define PCM_WATERMARK (CHUNK_SIZE * 3)
+#define PCM_WATERMARK (CHUNK_SIZE * 6)
static bool pcm_playing;
static bool pcm_paused;