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

@@ -96,7 +96,7 @@ static inline int32_t convertSample(MPC_SAMPLE_FORMAT sample)
return val;
}
static bool
static void
mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
{
mpc_decoder decoder;
@@ -135,21 +135,17 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
mpc_streaminfo_init(&info);
if ((ret = mpc_streaminfo_read(&info, &reader)) != ERROR_CODE_OK) {
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP)
ERROR("Not a valid musepack stream\n");
return false;
}
return true;
return;
}
mpc_decoder_setup(&decoder, &reader);
if (!mpc_decoder_initialize(&decoder, &info)) {
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP)
ERROR("Not a valid musepack stream\n");
return false;
}
return true;
return;
}
audio_format.bits = 24;
@@ -232,8 +228,6 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
}
replay_gain_info_free(replayGainInfo);
return true;
}
static float mpcGetTime(const char *file)