aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:06 +0200
committerEric Wong <normalperson@yhbt.net>2008-08-30 18:29:19 -0700
commit7750e5b1e8f989513ef982c4c4dca4dbe4fe7a92 (patch)
tree5db5514d36c18fa84d32f1cd0d692c5186fba21e
parent360c188c9d0460aff44f9c78bec25fcbab1cbead (diff)
downloadmpd-7750e5b1e8f989513ef982c4c4dca4dbe4fe7a92.tar.gz
mpd-7750e5b1e8f989513ef982c4c4dca4dbe4fe7a92.tar.xz
mpd-7750e5b1e8f989513ef982c4c4dca4dbe4fe7a92.zip
audiofile: use break instead of local variable "eof"
Similar to previous patch: eliminate one variable by using "break". This also simplifies the code since we can remove one level of indent. [ew: rewritten to match current API]
-rw-r--r--src/inputPlugins/audiofile_plugin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c
index 7f748fc1b..d32a99857 100644
--- a/src/inputPlugins/audiofile_plugin.c
+++ b/src/inputPlugins/audiofile_plugin.c
@@ -85,10 +85,10 @@ static int audiofile_decode(char *path)
fs = (int)afGetVirtualFrameSize(af_fp, AF_DEFAULT_TRACK, 1);
{
- int ret, eof = 0, current = 0;
+ int ret, current = 0;
char chunk[CHUNK_SIZE];
- while (!eof) {
+ while (1) {
if (dc_seek()) {
dc_action_begin();
current = dc.seek_where *
@@ -101,7 +101,7 @@ static int audiofile_decode(char *path)
afReadFrames(af_fp, AF_DEFAULT_TRACK, chunk,
CHUNK_SIZE / fs);
if (ret <= 0)
- eof = 1;
+ break;
else {
current += ret;
ob_send(chunk, ret * fs,