diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-02 18:35:24 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-02 18:35:24 +0000 |
commit | f3add928416e9b44a1db8456b49703ca259c0930 (patch) | |
tree | e095b4292d325cb3a348e8d6dfb701fede0917d5 | |
parent | d8ac6074184ffc21c4da8c594df72ee42aa23df2 (diff) | |
download | rockbox-f3add928416e9b44a1db8456b49703ca259c0930.tar.gz rockbox-f3add928416e9b44a1db8456b49703ca259c0930.zip |
Adjusted buffer watermarks for better crossfade and playback stability.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10416 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/pcmbuf.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 6d4c091745..2075fc66e7 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c | |||
@@ -36,7 +36,8 @@ | |||
36 | #include "audio.h" | 36 | #include "audio.h" |
37 | #include "dsp.h" | 37 | #include "dsp.h" |
38 | 38 | ||
39 | #define PCMBUF_WATERMARK (NATIVE_FREQUENCY * 4 * 1) | 39 | /* 1.5s low mark */ |
40 | #define PCMBUF_WATERMARK (NATIVE_FREQUENCY * 6) | ||
40 | 41 | ||
41 | /* Structure we can use to queue pcm chunks in memory to be played | 42 | /* Structure we can use to queue pcm chunks in memory to be played |
42 | * by the driver code. */ | 43 | * by the driver code. */ |
@@ -298,7 +299,7 @@ bool pcmbuf_crossfade_init(bool manual_skip) | |||
298 | } | 299 | } |
299 | 300 | ||
300 | /* Not enough data, or crossfade disabled, flush the old data instead */ | 301 | /* Not enough data, or crossfade disabled, flush the old data instead */ |
301 | if (LOW_DATA(6) || !pcmbuf_is_crossfade_enabled() || low_latency_mode) | 302 | if (LOW_DATA(2) || !pcmbuf_is_crossfade_enabled() || low_latency_mode) |
302 | { | 303 | { |
303 | pcmbuf_boost(true); | 304 | pcmbuf_boost(true); |
304 | pcmbuf_flush_fillpos(); | 305 | pcmbuf_flush_fillpos(); |
@@ -973,10 +974,10 @@ void pcmbuf_crossfade_enable(bool on_off) | |||
973 | crossfade_enabled = on_off; | 974 | crossfade_enabled = on_off; |
974 | 975 | ||
975 | if (crossfade_enabled) { | 976 | if (crossfade_enabled) { |
976 | /* If crossfading, try to keep the buffer full other than 2 second */ | 977 | /* If crossfading, try to keep the buffer full other than 1 second */ |
977 | pcmbuf_set_watermark_bytes(pcmbuf_size - PCMBUF_WATERMARK * 2); | 978 | pcmbuf_set_watermark_bytes(pcmbuf_size - (NATIVE_FREQUENCY * 4 * 1)); |
978 | } else { | 979 | } else { |
979 | /* Otherwise, just keep it above 1 second */ | 980 | /* Otherwise, just keep it above 2 second */ |
980 | pcmbuf_set_watermark_bytes(PCMBUF_WATERMARK); | 981 | pcmbuf_set_watermark_bytes(PCMBUF_WATERMARK); |
981 | } | 982 | } |
982 | } | 983 | } |