summaryrefslogtreecommitdiff
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
parent03dd35db0e22c971b09fc94fa24cce6f531ab7ce (diff)
downloadrockbox-3379440a4bfecef85c915fb079b595f98a6db1de.tar.gz
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
-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 */
133 133
134/* Configuration */ 134/* Configuration */
135static size_t conf_watermark = 0; /* Level to trigger filebuf fill */ 135static size_t conf_watermark = 0; /* Level to trigger filebuf fill */
136static size_t conf_filechunk = 0; /* Bytes-per-read for buffering (impacts
137 responsiveness of buffering thread) */
138#if MEM > 8 136#if MEM > 8
139static size_t high_watermark = 0; /* High watermark for rebuffer */ 137static size_t high_watermark = 0; /* High watermark for rebuffer */
140#endif 138#endif
@@ -167,7 +165,8 @@ static struct {
167 165
168/* Messages available to communicate with the buffering thread */ 166/* Messages available to communicate with the buffering thread */
169enum { 167enum {
170 Q_BUFFER_HANDLE = 1, /* Request buffering of a handle */ 168 Q_BUFFER_HANDLE = 1, /* Request buffering of a handle, this should not be
169 used in a low buffer situation. */
171 Q_RESET_HANDLE, /* (internal) Request resetting of a handle to its 170 Q_RESET_HANDLE, /* (internal) Request resetting of a handle to its
172 offset (the offset has to be set beforehand) */ 171 offset (the offset has to be set beforehand) */
173 Q_CLOSE_HANDLE, /* Request closing a handle */ 172 Q_CLOSE_HANDLE, /* Request closing a handle */
@@ -552,7 +551,7 @@ static bool buffer_handle(int handle_id)
552 while (h->filerem > 0) 551 while (h->filerem > 0)
553 { 552 {
554 /* max amount to copy */ 553 /* max amount to copy */
555 size_t copy_n = MIN( MIN(h->filerem, conf_filechunk), 554 size_t copy_n = MIN( MIN(h->filerem, BUFFERING_DEFAULT_FILECHUNK),
556 buffer_len - h->widx); 555 buffer_len - h->widx);
557 556
558 /* stop copying if it would overwrite the reading position */ 557 /* stop copying if it would overwrite the reading position */
@@ -1101,23 +1100,10 @@ size_t buf_used(void)
1101 return BUF_USED; 1100 return BUF_USED;
1102} 1101}
1103 1102
1104void buf_set_conf(int setting, size_t value) 1103void buf_set_watermark(size_t bytes)
1105{ 1104{
1106 int msg; 1105 LOGFQUEUE("buffering > Q_SET_WATERMARK %ld", bytes);
1107 switch (setting) 1106 queue_post(&buffering_queue, Q_SET_WATERMARK, bytes);
1108 {
1109 case BUFFERING_SET_WATERMARK:
1110 msg = Q_SET_WATERMARK;
1111 break;
1112
1113 case BUFFERING_SET_CHUNKSIZE:
1114 msg = Q_SET_CHUNKSIZE;
1115 break;
1116
1117 default:
1118 return;
1119 }
1120 queue_post(&buffering_queue, msg, value);
1121} 1107}
1122 1108
1123bool register_buffer_low_callback(buffer_low_callback func) 1109bool register_buffer_low_callback(buffer_low_callback func)
@@ -1228,22 +1214,11 @@ void buffering_thread(void)
1228 case Q_SET_WATERMARK: 1214 case Q_SET_WATERMARK:
1229 LOGFQUEUE("buffering < Q_SET_WATERMARK"); 1215 LOGFQUEUE("buffering < Q_SET_WATERMARK");
1230 conf_watermark = (size_t)ev.data; 1216 conf_watermark = (size_t)ev.data;
1231 if (conf_watermark < conf_filechunk) 1217 if (conf_watermark < BUFFERING_DEFAULT_FILECHUNK)
1232 {
1233 logf("wmark<chunk %ld<%ld", conf_watermark, conf_filechunk);
1234 conf_watermark = conf_filechunk;
1235 }
1236 break;
1237
1238 case Q_SET_CHUNKSIZE:
1239 LOGFQUEUE("buffering < Q_SET_CHUNKSIZE");
1240 conf_filechunk = (size_t)ev.data;
1241 if (conf_filechunk == 0)
1242 conf_filechunk = BUFFERING_DEFAULT_FILECHUNK;
1243 if (conf_filechunk > conf_watermark)
1244 { 1218 {
1245 logf("chunk>wmark %ld>%ld", conf_filechunk, conf_watermark); 1219 logf("wmark<chunk %ld<%d",
1246 conf_watermark = conf_filechunk; 1220 conf_watermark, BUFFERING_DEFAULT_FILECHUNK);
1221 conf_watermark = BUFFERING_DEFAULT_FILECHUNK;
1247 } 1222 }
1248 break; 1223 break;
1249 1224
@@ -1308,7 +1283,6 @@ void buffering_thread(void)
1308void buffering_init(void) { 1283void buffering_init(void) {
1309 mutex_init(&llist_mutex); 1284 mutex_init(&llist_mutex);
1310 1285
1311 conf_filechunk = BUFFERING_DEFAULT_FILECHUNK;
1312 conf_watermark = BUFFERING_DEFAULT_WATERMARK; 1286 conf_watermark = BUFFERING_DEFAULT_WATERMARK;
1313 1287
1314 queue_init(&buffering_queue, true); 1288 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 {
117 BUFFERING_SET_WATERMARK = 1, 117 BUFFERING_SET_WATERMARK = 1,
118 BUFFERING_SET_CHUNKSIZE, 118 BUFFERING_SET_CHUNKSIZE,
119}; 119};
120void buf_set_conf(int setting, size_t value); 120void buf_set_watermark(size_t bytes);
121 121
122 122
123/* Debugging */ 123/* 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)
124 /* Generic codec initialisation */ 124 /* Generic codec initialisation */
125 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED); 125 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
126 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 126 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
127 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
128 127
129next_track: 128next_track:
130 if (codec_init()) { 129 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)
53 unsigned char c = 0; 53 unsigned char c = 0;
54 54
55 /* Generic codec initialisation */ 55 /* Generic codec initialisation */
56 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
57 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 56 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
58 57
59 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED); 58 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)
55 /* Generic codec initialisation */ 55 /* Generic codec initialisation */
56 /* we only render 16 bits */ 56 /* we only render 16 bits */
57 ci->configure(DSP_SET_SAMPLE_DEPTH, 16); 57 ci->configure(DSP_SET_SAMPLE_DEPTH, 16);
58 /*ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);*/
59 58
60next_track: 59next_track:
61 DEBUGF("ADX: next_track\n"); 60 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)
65 /* Generic codec initialisation */ 65 /* Generic codec initialisation */
66 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 66 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
67 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 67 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
68 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
69 68
70next_track: 69next_track:
71 if (codec_init()) { 70 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)
43 43
44 /* Generic codec initialisation */ 44 /* Generic codec initialisation */
45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
46 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
47 46
48 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED); 47 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
49 ci->configure(DSP_SET_SAMPLE_DEPTH, ALAC_OUTPUT_DEPTH-1); 48 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)
147 147
148 /* Generic codec initialisation */ 148 /* Generic codec initialisation */
149 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 149 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
150 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
151 150
152 ci->configure(DSP_SET_SAMPLE_DEPTH, APE_OUTPUT_DEPTH-1); 151 ci->configure(DSP_SET_SAMPLE_DEPTH, APE_OUTPUT_DEPTH-1);
153 152
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)
422 422
423 /* Generic codec initialisation */ 423 /* Generic codec initialisation */
424 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 424 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
425 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
426 425
427 ci->configure(DSP_SET_SAMPLE_DEPTH, FLAC_OUTPUT_DEPTH-1); 426 ci->configure(DSP_SET_SAMPLE_DEPTH, FLAC_OUTPUT_DEPTH-1);
428 427
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)
79 /* Create a decoder instance */ 79 /* Create a decoder instance */
80 80
81 ci->configure(DSP_SET_SAMPLE_DEPTH, MAD_F_FRACBITS); 81 ci->configure(DSP_SET_SAMPLE_DEPTH, MAD_F_FRACBITS);
82 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
83 82
84next_track: 83next_track:
85 status = CODEC_OK; 84 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)
78 int retval = CODEC_OK; 78 int retval = CODEC_OK;
79 79
80 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 80 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
81 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
82 81
83 /* Create a decoder instance */ 82 /* Create a decoder instance */
84 reader.read = read_impl; 83 reader.read = read_impl;
@@ -133,14 +132,12 @@ next_track:
133 /* Resume to saved sample offset. */ 132 /* Resume to saved sample offset. */
134 if(samplesdone > 0) { 133 if(samplesdone > 0) {
135 /* hack to improve seek time if filebuf goes empty */ 134 /* hack to improve seek time if filebuf goes empty */
136 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*512);
137 if (mpc_decoder_seek_sample(&decoder, samplesdone)) { 135 if (mpc_decoder_seek_sample(&decoder, samplesdone)) {
138 ci->set_elapsed(samplesdone/frequency); 136 ci->set_elapsed(samplesdone/frequency);
139 } else { 137 } else {
140 samplesdone = 0; 138 samplesdone = 0;
141 } 139 }
142 /* reset chunksize */ 140 /* reset chunksize */
143 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
144 } 141 }
145 142
146 /* This is the decoding loop. */ 143 /* This is the decoding loop. */
@@ -149,7 +146,6 @@ next_track:
149 /* Complete seek handler. */ 146 /* Complete seek handler. */
150 if (ci->seek_time) { 147 if (ci->seek_time) {
151 /* hack to improve seek time if filebuf goes empty */ 148 /* hack to improve seek time if filebuf goes empty */
152 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*512);
153 mpc_int64_t new_offset = (ci->seek_time - 1)*frequency; 149 mpc_int64_t new_offset = (ci->seek_time - 1)*frequency;
154 if (mpc_decoder_seek_sample(&decoder, new_offset)) { 150 if (mpc_decoder_seek_sample(&decoder, new_offset)) {
155 samplesdone = new_offset; 151 samplesdone = new_offset;
@@ -157,7 +153,6 @@ next_track:
157 } 153 }
158 ci->seek_complete(); 154 ci->seek_complete();
159 /* reset chunksize */ 155 /* reset chunksize */
160 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
161 156
162 } 157 }
163 #else 158 #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)
46 46
47 /* Generic codec initialisation */ 47 /* Generic codec initialisation */
48 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 48 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
49 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
50 49
51 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED); 50 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
52 ci->configure(DSP_SET_SAMPLE_DEPTH, SHN_OUTPUT_DEPTH-1); 51 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)
1215 1215
1216 /* Generic codec initialisation */ 1216 /* Generic codec initialisation */
1217 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 1217 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
1218 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
1219 1218
1220next_track: 1219next_track:
1221 if (codec_init()) { 1220 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)
117 * they should be set differently based on quality setting 117 * they should be set differently based on quality setting
118 */ 118 */
119 119
120 /* The chunk size below is magic. If set any lower, resume
121 * doesn't work properly (ov_raw_seek() does the wrong thing).
122 */
123 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
124
125/* We need to flush reserver memory every track load. */ 120/* We need to flush reserver memory every track load. */
126next_track: 121next_track:
127 if (codec_init()) { 122 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)
227 /* Generic codec initialisation */ 227 /* Generic codec initialisation */
228 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 228 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
229 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 229 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
230 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
231 230
232next_track: 231next_track:
233 if (codec_init()) { 232 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)
43 43
44 /* Generic codec initialisation */ 44 /* Generic codec initialisation */
45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
46 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
47 46
48 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 47 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
49 48
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)
317 317
318 /* Generic codec initialisation */ 318 /* Generic codec initialisation */
319 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512); 319 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
320 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
321 320
322 ci->configure(DSP_SET_SAMPLE_DEPTH, 30); 321 ci->configure(DSP_SET_SAMPLE_DEPTH, 30);
323 322
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
35enum 35enum
36{ 36{
37 CODEC_SET_FILEBUF_WATERMARK = 1, 37 CODEC_SET_FILEBUF_WATERMARK = 1,
38 CODEC_SET_FILEBUF_CHUNKSIZE,
39 DSP_SWITCH_CODEC, 38 DSP_SWITCH_CODEC,
40 DSP_SET_FREQUENCY, 39 DSP_SET_FREQUENCY,
41 DSP_SWITCH_FREQUENCY, 40 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 @@
90 90
91/* default point to start buffer refill */ 91/* default point to start buffer refill */
92#define AUDIO_DEFAULT_WATERMARK (1024*512) 92#define AUDIO_DEFAULT_WATERMARK (1024*512)
93/* amount of data to read in one read() call */
94#define AUDIO_DEFAULT_FILECHUNK (1024*32)
95/* amount of guess-space to allow for codecs that must hunt and peck 93/* amount of guess-space to allow for codecs that must hunt and peck
96 * for their correct seeek target, 32k seems a good size */ 94 * for their correct seeek target, 32k seems a good size */
97#define AUDIO_REBUFFER_GUESS_SIZE (1024*32) 95#define AUDIO_REBUFFER_GUESS_SIZE (1024*32)
@@ -1036,7 +1034,7 @@ static void set_filebuf_watermark(int seconds, size_t max)
1036 1034
1037 bytes = seconds?MAX(curtrack_id3.bitrate * seconds * (1000/8), max):max; 1035 bytes = seconds?MAX(curtrack_id3.bitrate * seconds * (1000/8), max):max;
1038 bytes = MIN(bytes, filebuflen / 2); 1036 bytes = MIN(bytes, filebuflen / 2);
1039 buf_set_conf(BUFFERING_SET_WATERMARK, bytes); 1037 buf_set_watermark(bytes);
1040} 1038}
1041 1039
1042const char * get_codec_filename(int cod_spec) 1040const char * get_codec_filename(int cod_spec)
@@ -1659,10 +1657,6 @@ static void codec_configure_callback(int setting, intptr_t value)
1659 set_filebuf_watermark(buffer_margin, value); 1657 set_filebuf_watermark(buffer_margin, value);
1660 break; 1658 break;
1661 1659
1662 case CODEC_SET_FILEBUF_CHUNKSIZE:
1663 buf_set_conf(BUFFERING_SET_CHUNKSIZE, value);
1664 break;
1665
1666 default: 1660 default:
1667 if (!dsp_configure(setting, value)) { logf("Illegal key:%d", setting); } 1661 if (!dsp_configure(setting, value)) { logf("Illegal key:%d", setting); }
1668 } 1662 }
@@ -2289,8 +2283,7 @@ static bool audio_load_track(int offset, bool start_play)
2289 int last_codec = current_codec; 2283 int last_codec = current_codec;
2290 2284
2291 set_current_codec(CODEC_IDX_AUDIO); 2285 set_current_codec(CODEC_IDX_AUDIO);
2292 buf_set_conf(BUFFERING_SET_WATERMARK, AUDIO_DEFAULT_WATERMARK); 2286 buf_set_watermark(AUDIO_DEFAULT_WATERMARK);
2293 buf_set_conf(BUFFERING_SET_CHUNKSIZE, AUDIO_DEFAULT_FILECHUNK);
2294 dsp_configure(DSP_RESET, 0); 2287 dsp_configure(DSP_RESET, 0);
2295 set_current_codec(last_codec); 2288 set_current_codec(last_codec);
2296 2289