summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2007-11-04 06:01:46 +0000
committerBrandon Low <lostlogic@rockbox.org>2007-11-04 06:01:46 +0000
commit2ecb3231c697d05c052fd22c040c0e59c2798cd5 (patch)
tree584b1d22748633bf9d926a91fc79ae30c12e9f0b
parentebc981b23305e5b0485d4acb0fc8c9cd674e9559 (diff)
More residuals from 8077, sanitize chunk and watermark settings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15452 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/buffering.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index a0e6f66772..b35206766b 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -1215,11 +1215,23 @@ void buffering_thread(void)
case Q_SET_WATERMARK:
LOGFQUEUE("buffering < Q_SET_WATERMARK");
conf_watermark = (size_t)ev.data;
+ if (conf_watermark < conf_filechunk)
+ {
+ logf("wmark<chunk %ld<%ld", conf_watermark, conf_filechunk);
+ conf_watermark = conf_filechunk;
+ }
break;
case Q_SET_CHUNKSIZE:
LOGFQUEUE("buffering < Q_SET_CHUNKSIZE");
conf_filechunk = (size_t)ev.data;
+ if (conf_filechunk == 0)
+ conf_filechunk = BUFFERING_DEFAULT_FILECHUNK;
+ if (conf_filechunk > conf_watermark)
+ {
+ logf("chunk>wmark %ld>%ld", conf_filechunk, conf_watermark);
+ conf_watermark = conf_filechunk;
+ }
break;
case Q_SET_PRESEEK: