aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/audiofile_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-30 08:38:54 +0100
committerMax Kellermann <max@duempel.org>2008-10-30 08:38:54 +0100
commit62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca (patch)
tree565dd0a8c2c50a31dac369408e6b499eb7daafb5 /src/decoder/audiofile_plugin.c
parentd29bad441066919f808c4ad1657bc5600fd9bd45 (diff)
downloadmpd-62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca.tar.gz
mpd-62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca.tar.xz
mpd-62d4fa9306fdb5dd0a1b592fd8dbdf1b679d92ca.zip
decoder: use bool for return values and flags
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
Diffstat (limited to '')
-rw-r--r--src/decoder/audiofile_plugin.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/audiofile_plugin.c b/src/decoder/audiofile_plugin.c
index 5e5eb2cb6..5c1e0a0d0 100644
--- a/src/decoder/audiofile_plugin.c
+++ b/src/decoder/audiofile_plugin.c
@@ -41,7 +41,8 @@ static int getAudiofileTotalTime(char *file)
return total_time;
}
-static int audiofile_decode(struct decoder * decoder, char *path)
+static bool
+audiofile_decode(struct decoder *decoder, char *path)
{
int fs, frame_count;
AFfilehandle af_fp;
@@ -55,13 +56,13 @@ static int audiofile_decode(struct decoder * decoder, char *path)
if (stat(path, &st) < 0) {
ERROR("failed to stat: %s\n", path);
- return -1;
+ return false;
}
af_fp = afOpenFile(path, "r", NULL);
if (af_fp == AF_NULL_FILEHANDLE) {
ERROR("failed to open: %s\n", path);
- return -1;
+ return false;
}
afSetVirtualSampleFormat(af_fp, AF_DEFAULT_TRACK,
@@ -83,7 +84,7 @@ static int audiofile_decode(struct decoder * decoder, char *path)
ERROR("Only 8 and 16-bit files are supported. %s is %i-bit\n",
path, audio_format.bits);
afCloseFile(af_fp);
- return -1;
+ return false;
}
fs = (int)afGetVirtualFrameSize(af_fp, AF_DEFAULT_TRACK, 1);
@@ -111,7 +112,7 @@ static int audiofile_decode(struct decoder * decoder, char *path)
} while (decoder_get_command(decoder) != DECODE_COMMAND_STOP);
afCloseFile(af_fp);
- return 0;
+ return true;
}
static struct tag *audiofileTagDup(char *file)