summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-04-25 18:21:05 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-04-25 18:21:05 +0000
commit522ec278ef05ea9831f51d64e41a4121272e2152 (patch)
tree0e8baa142abe992c422f9ce3b7e074cbdbcb86fc
parent2306433eb70628d2f9c042ced7ea0d2912e31cc9 (diff)
downloadrockbox-522ec278ef05ea9831f51d64e41a4121272e2152.zip
rockbox-522ec278ef05ea9831f51d64e41a4121272e2152.tar.gz
rockbox-522ec278ef05ea9831f51d64e41a4121272e2152.tar.bz2
rockbox-522ec278ef05ea9831f51d64e41a4121272e2152.tar.xz
Switch inserts back from do while to while loops, because mpc likes to insert zero byte chunks at the end of files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9802 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/playback.c b/apps/playback.c
index b3514cb..cccf1a9 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -322,7 +322,8 @@ static bool voice_pcmbuf_insert_split_callback(
if (dsp_stereo_mode() == STEREO_NONINTERLEAVED)
length *= 2; /* Length is per channel */
- do {
+ while (length)
+ {
long est_output_size = dsp_output_size(length);
while ((dest = pcmbuf_request_voice_buffer(est_output_size,
&output_size, playing)) == NULL)
@@ -359,9 +360,7 @@ static bool voice_pcmbuf_insert_split_callback(
pcmbuf_write_complete(output_size);
length -= input_size;
-
- } while (length > 0);
-
+ }
return true;
}
@@ -380,7 +379,8 @@ static bool codec_pcmbuf_insert_split_callback(
if (dsp_stereo_mode() == STEREO_NONINTERLEAVED)
length *= 2; /* Length is per channel */
- do {
+ while (length)
+ {
long est_output_size = dsp_output_size(length);
/* Prevent audio from a previous track from playing */
if (ci.new_track || ci.stop_codec)
@@ -418,8 +418,7 @@ static bool codec_pcmbuf_insert_split_callback(
swap_codec();
length -= input_size;
-
- } while (length > 0);
+ }
return true;
}