decoder: return void from decode() methods

The stream_decode() and file_decode() methods returned a boolean,
indicating whether they were able to decode the song.  This is
redundant, since we already know that: if decoder_initialized() has
been called (and dc.state==DECODE), the plugin succeeded.  Change both
methods to return void.
This commit is contained in:
Max Kellermann
2008-11-11 17:13:44 +01:00
parent 05e69ac086
commit 9eed41911f
13 changed files with 56 additions and 113 deletions

View File

@@ -41,7 +41,7 @@ static int getAudiofileTotalTime(const char *file)
return total_time;
}
static bool
static void
audiofile_decode(struct decoder *decoder, const char *path)
{
int fs, frame_count;
@@ -56,13 +56,13 @@ audiofile_decode(struct decoder *decoder, const char *path)
if (stat(path, &st) < 0) {
ERROR("failed to stat: %s\n", path);
return false;
return;
}
af_fp = afOpenFile(path, "r", NULL);
if (af_fp == AF_NULL_FILEHANDLE) {
ERROR("failed to open: %s\n", path);
return false;
return;
}
afSetVirtualSampleFormat(af_fp, AF_DEFAULT_TRACK,
@@ -84,7 +84,7 @@ audiofile_decode(struct decoder *decoder, const char *path)
ERROR("Only 8 and 16-bit files are supported. %s is %i-bit\n",
path, audio_format.bits);
afCloseFile(af_fp);
return false;
return;
}
fs = (int)afGetVirtualFrameSize(af_fp, AF_DEFAULT_TRACK, 1);
@@ -112,7 +112,6 @@ audiofile_decode(struct decoder *decoder, const char *path)
} while (decoder_get_command(decoder) != DECODE_COMMAND_STOP);
afCloseFile(af_fp);
return true;
}
static struct tag *audiofileTagDup(const char *file)