summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2007-11-05 17:48:21 +0000
committerBrandon Low <lostlogic@rockbox.org>2007-11-05 17:48:21 +0000
commit3379440a4bfecef85c915fb079b595f98a6db1de (patch)
treeb0d00f72449f78de08e1db8884a7ee1936423752 /apps
parent03dd35db0e22c971b09fc94fa24cce6f531ab7ce (diff)
downloadrockbox-3379440a4bfecef85c915fb079b595f98a6db1de.tar.gz
rockbox-3379440a4bfecef85c915fb079b595f98a6db1de.tar.bz2
rockbox-3379440a4bfecef85c915fb079b595f98a6db1de.zip
Remove conf_filechunk, it should never have been a setting and its implementation doesn't do what it claims any way
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15478 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/buffering.c46
-rw-r--r--apps/buffering.h2
-rw-r--r--apps/codecs/a52.c1
-rw-r--r--apps/codecs/aac.c1
-rw-r--r--apps/codecs/adx.c1
-rw-r--r--apps/codecs/aiff.c1
-rw-r--r--apps/codecs/alac.c1
-rw-r--r--apps/codecs/ape.c1
-rw-r--r--apps/codecs/flac.c1
-rw-r--r--apps/codecs/mpa.c1
-rw-r--r--apps/codecs/mpc.c5
-rw-r--r--apps/codecs/shorten.c1
-rw-r--r--apps/codecs/sid.c1
-rw-r--r--apps/codecs/vorbis.c5
-rw-r--r--apps/codecs/wav.c1
-rw-r--r--apps/codecs/wavpack.c1
-rw-r--r--apps/codecs/wma.c1
-rw-r--r--apps/dsp.h1
-rw-r--r--apps/playback.c11
19 files changed, 13 insertions, 70 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 811c1e5d65..651ec4c2ff 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -133,8 +133,6 @@ static volatile size_t buf_ridx; /* current reading position */
/* Configuration */
static size_t conf_watermark = 0; /* Level to trigger filebuf fill */
-static size_t conf_filechunk = 0; /* Bytes-per-read for buffering (impacts
- responsiveness of buffering thread) */
#if MEM > 8
static size_t high_watermark = 0; /* High watermark for rebuffer */
#endif
@@ -167,7 +165,8 @@ static struct {
/* Messages available to communicate with the buffering thread */
enum {
- Q_BUFFER_HANDLE = 1, /* Request buffering of a handle */
+ Q_BUFFER_HANDLE = 1, /* Request buffering of a handle, this should not be
+ used in a low buffer situation. */
Q_RESET_HANDLE, /* (internal) Request resetting of a handle to its
offset (the offset has to be set beforehand) */
Q_CLOSE_HANDLE, /* Request closing a handle */
@@ -552,7 +551,7 @@ static bool buffer_handle(int handle_id)
while (h->filerem > 0)
{
/* max amount to copy */
- size_t copy_n = MIN( MIN(h->filerem, conf_filechunk),
+ size_t copy_n = MIN( MIN(h->filerem, BUFFERING_DEFAULT_FILECHUNK),
buffer_len - h->widx);
/* stop copying if it would overwrite the reading position */
@@ -1101,23 +1100,10 @@ size_t buf_used(void)
return BUF_USED;
}
-void buf_set_conf(int setting, size_t value)
+void buf_set_watermark(size_t bytes)
{
- int msg;
- switch (setting)
- {
- case BUFFERING_SET_WATERMARK:
- msg = Q_SET_WATERMARK;
- break;
-
- case BUFFERING_SET_CHUNKSIZE:
- msg = Q_SET_CHUNKSIZE;
- break;
-
- default:
- return;
- }
- queue_post(&buffering_queue, msg, value);
+ LOGFQUEUE("buffering > Q_SET_WATERMARK %ld", bytes);
+ queue_post(&buffering_queue, Q_SET_WATERMARK, bytes);
}
bool register_buffer_low_callback(buffer_low_callback func)
@@ -1228,22 +1214,11 @@ 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)
+ if (conf_watermark < BUFFERING_DEFAULT_FILECHUNK)
{
- logf("chunk>wmark %ld>%ld", conf_filechunk, conf_watermark);
- conf_watermark = conf_filechunk;
+ logf("wmark<chunk %ld<%d",
+ conf_watermark, BUFFERING_DEFAULT_FILECHUNK);
+ conf_watermark = BUFFERING_DEFAULT_FILECHUNK;
}
break;
@@ -1308,7 +1283,6 @@ void buffering_thread(void)
void buffering_init(void) {
mutex_init(&llist_mutex);
- conf_filechunk = BUFFERING_DEFAULT_FILECHUNK;
conf_watermark = BUFFERING_DEFAULT_WATERMARK;
queue_init(&buffering_queue, true);
diff --git a/apps/buffering.h b/apps/buffering.h
index 139dea7509..1d69df2084 100644
--- a/apps/buffering.h
+++ b/apps/buffering.h
@@ -117,7 +117,7 @@ enum {
BUFFERING_SET_WATERMARK = 1,
BUFFERING_SET_CHUNKSIZE,
};
-void buf_set_conf(int setting, size_t value);
+void buf_set_watermark(size_t bytes);
/* Debugging */
diff --git a/apps/codecs/a52.c b/apps/codecs/a52.c
index b2229d4c49..6cdddb5213 100644
--- a/apps/codecs/a52.c
+++ b/apps/codecs/a52.c
@@ -124,7 +124,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
next_track:
if (codec_init()) {
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index d4f051c09c..d3422ea447 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -53,7 +53,6 @@ enum codec_status codec_main(void)
unsigned char c = 0;
/* Generic codec initialisation */
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
diff --git a/apps/codecs/adx.c b/apps/codecs/adx.c
index bf339675c7..715df579d7 100644
--- a/apps/codecs/adx.c
+++ b/apps/codecs/adx.c
@@ -55,7 +55,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
/* we only render 16 bits */
ci->configure(DSP_SET_SAMPLE_DEPTH, 16);
- /*ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);*/
next_track:
DEBUGF("ADX: next_track\n");
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c
index d663b4b367..93a7c39489 100644
--- a/apps/codecs/aiff.c
+++ b/apps/codecs/aiff.c
@@ -65,7 +65,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
next_track:
if (codec_init()) {
diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c
index bedd2dd581..9abbfe8ede 100644
--- a/apps/codecs/alac.c
+++ b/apps/codecs/alac.c
@@ -43,7 +43,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
ci->configure(DSP_SET_SAMPLE_DEPTH, ALAC_OUTPUT_DEPTH-1);
diff --git a/apps/codecs/ape.c b/apps/codecs/ape.c
index 0506c0ca49..6679a1a307 100644
--- a/apps/codecs/ape.c
+++ b/apps/codecs/ape.c
@@ -147,7 +147,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
ci->configure(DSP_SET_SAMPLE_DEPTH, APE_OUTPUT_DEPTH-1);
diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c
index d1c52833a6..3566725772 100644
--- a/apps/codecs/flac.c
+++ b/apps/codecs/flac.c
@@ -422,7 +422,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
ci->configure(DSP_SET_SAMPLE_DEPTH, FLAC_OUTPUT_DEPTH-1);
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c
index 113c81b2a0..e9667973f7 100644
--- a/apps/codecs/mpa.c
+++ b/apps/codecs/mpa.c
@@ -79,7 +79,6 @@ enum codec_status codec_main(void)
/* Create a decoder instance */
ci->configure(DSP_SET_SAMPLE_DEPTH, MAD_F_FRACBITS);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
next_track:
status = CODEC_OK;
diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c
index 4db8a186a2..207a09445f 100644
--- a/apps/codecs/mpc.c
+++ b/apps/codecs/mpc.c
@@ -78,7 +78,6 @@ enum codec_status codec_main(void)
int retval = CODEC_OK;
ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
/* Create a decoder instance */
reader.read = read_impl;
@@ -133,14 +132,12 @@ next_track:
/* Resume to saved sample offset. */
if(samplesdone > 0) {
/* hack to improve seek time if filebuf goes empty */
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*512);
if (mpc_decoder_seek_sample(&decoder, samplesdone)) {
ci->set_elapsed(samplesdone/frequency);
} else {
samplesdone = 0;
}
/* reset chunksize */
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
}
/* This is the decoding loop. */
@@ -149,7 +146,6 @@ next_track:
/* Complete seek handler. */
if (ci->seek_time) {
/* hack to improve seek time if filebuf goes empty */
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*512);
mpc_int64_t new_offset = (ci->seek_time - 1)*frequency;
if (mpc_decoder_seek_sample(&decoder, new_offset)) {
samplesdone = new_offset;
@@ -157,7 +153,6 @@ next_track:
}
ci->seek_complete();
/* reset chunksize */
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
}
#else
diff --git a/apps/codecs/shorten.c b/apps/codecs/shorten.c
index fdc8142041..82345e0af7 100644
--- a/apps/codecs/shorten.c
+++ b/apps/codecs/shorten.c
@@ -46,7 +46,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
ci->configure(DSP_SET_SAMPLE_DEPTH, SHN_OUTPUT_DEPTH-1);
diff --git a/apps/codecs/sid.c b/apps/codecs/sid.c
index c6d3c43170..bb43aef680 100644
--- a/apps/codecs/sid.c
+++ b/apps/codecs/sid.c
@@ -1215,7 +1215,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
next_track:
if (codec_init()) {
diff --git a/apps/codecs/vorbis.c b/apps/codecs/vorbis.c
index 2ea0f74645..2f7a4f4f72 100644
--- a/apps/codecs/vorbis.c
+++ b/apps/codecs/vorbis.c
@@ -117,11 +117,6 @@ enum codec_status codec_main(void)
* they should be set differently based on quality setting
*/
- /* The chunk size below is magic. If set any lower, resume
- * doesn't work properly (ov_raw_seek() does the wrong thing).
- */
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
-
/* We need to flush reserver memory every track load. */
next_track:
if (codec_init()) {
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c
index ae29bdedc7..504292a8b3 100644
--- a/apps/codecs/wav.c
+++ b/apps/codecs/wav.c
@@ -227,7 +227,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
next_track:
if (codec_init()) {
diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c
index 1485eedf8b..87581db4e6 100644
--- a/apps/codecs/wavpack.c
+++ b/apps/codecs/wavpack.c
@@ -43,7 +43,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
diff --git a/apps/codecs/wma.c b/apps/codecs/wma.c
index c29386482c..958cf1525b 100644
--- a/apps/codecs/wma.c
+++ b/apps/codecs/wma.c
@@ -317,7 +317,6 @@ enum codec_status codec_main(void)
/* Generic codec initialisation */
ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
- ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
ci->configure(DSP_SET_SAMPLE_DEPTH, 30);
diff --git a/apps/dsp.h b/apps/dsp.h
index fffcba20e1..838dc617ee 100644
--- a/apps/dsp.h
+++ b/apps/dsp.h
@@ -35,7 +35,6 @@ enum
enum
{
CODEC_SET_FILEBUF_WATERMARK = 1,
- CODEC_SET_FILEBUF_CHUNKSIZE,
DSP_SWITCH_CODEC,
DSP_SET_FREQUENCY,
DSP_SWITCH_FREQUENCY,
diff --git a/apps/playback.c b/apps/playback.c
index b31db800ad..94a0430872 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -90,8 +90,6 @@
/* default point to start buffer refill */
#define AUDIO_DEFAULT_WATERMARK (1024*512)
-/* amount of data to read in one read() call */
-#define AUDIO_DEFAULT_FILECHUNK (1024*32)
/* amount of guess-space to allow for codecs that must hunt and peck
* for their correct seeek target, 32k seems a good size */
#define AUDIO_REBUFFER_GUESS_SIZE (1024*32)
@@ -1036,7 +1034,7 @@ static void set_filebuf_watermark(int seconds, size_t max)
bytes = seconds?MAX(curtrack_id3.bitrate * seconds * (1000/8), max):max;
bytes = MIN(bytes, filebuflen / 2);
- buf_set_conf(BUFFERING_SET_WATERMARK, bytes);
+ buf_set_watermark(bytes);
}
const char * get_codec_filename(int cod_spec)
@@ -1659,10 +1657,6 @@ static void codec_configure_callback(int setting, intptr_t value)
set_filebuf_watermark(buffer_margin, value);
break;
- case CODEC_SET_FILEBUF_CHUNKSIZE:
- buf_set_conf(BUFFERING_SET_CHUNKSIZE, value);
- break;
-
default:
if (!dsp_configure(setting, value)) { logf("Illegal key:%d", setting); }
}
@@ -2289,8 +2283,7 @@ static bool audio_load_track(int offset, bool start_play)
int last_codec = current_codec;
set_current_codec(CODEC_IDX_AUDIO);
- buf_set_conf(BUFFERING_SET_WATERMARK, AUDIO_DEFAULT_WATERMARK);
- buf_set_conf(BUFFERING_SET_CHUNKSIZE, AUDIO_DEFAULT_FILECHUNK);
+ buf_set_watermark(AUDIO_DEFAULT_WATERMARK);
dsp_configure(DSP_RESET, 0);
set_current_codec(last_codec);