From 522ec278ef05ea9831f51d64e41a4121272e2152 Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Tue, 25 Apr 2006 18:21:05 +0000 Subject: [PATCH] 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 --- apps/playback.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index b3514cbf41..cccf1a9b46 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; }