From 9eed41911f5b65bb51d2395388439918e799cade Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 11 Nov 2008 17:13:44 +0100 Subject: 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. --- src/decoder/aac_plugin.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/decoder/aac_plugin.c') diff --git a/src/decoder/aac_plugin.c b/src/decoder/aac_plugin.c index 81ad90e69..7847a0f98 100644 --- a/src/decoder/aac_plugin.c +++ b/src/decoder/aac_plugin.c @@ -301,7 +301,7 @@ static int getAacTotalTime(const char *file) return file_time; } -static bool +static void aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) { float file_time; @@ -354,7 +354,7 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) faacDecClose(decoder); if (b.buffer) free(b.buffer); - return false; + return; } audio_format.bits = 16; @@ -419,15 +419,10 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) faacDecClose(decoder); if (b.buffer) free(b.buffer); - - if (!initialized) - return false; - - return true; } -static bool +static void aac_decode(struct decoder *mpd_decoder, const char *path) { float file_time; @@ -451,10 +446,10 @@ aac_decode(struct decoder *mpd_decoder, const char *path) bool initialized = false; if ((totalTime = getAacFloatTotalTime(path)) < 0) - return false; + return; if (!input_stream_open(&inStream, path)) - return false; + return; initAacBuffer(&b, mpd_decoder, &inStream); aac_parse_header(&b, NULL); @@ -484,7 +479,7 @@ aac_decode(struct decoder *mpd_decoder, const char *path) faacDecClose(decoder); if (b.buffer) free(b.buffer); - return false; + return; } audio_format.bits = 16; @@ -547,11 +542,6 @@ aac_decode(struct decoder *mpd_decoder, const char *path) faacDecClose(decoder); if (b.buffer) free(b.buffer); - - if (!initialized) - return false; - - return true; } static struct tag *aacTagDup(const char *file) -- cgit v1.2.3