aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/mp4_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-11 17:13:44 +0100
committerMax Kellermann <max@duempel.org>2008-11-11 17:13:44 +0100
commit9eed41911f5b65bb51d2395388439918e799cade (patch)
tree7d9ce92fe427b7049fc50087923b5fa8ecb53eff /src/decoder/mp4_plugin.c
parent05e69ac0868658411123f8c549b7f34c2c478742 (diff)
downloadmpd-9eed41911f5b65bb51d2395388439918e799cade.tar.gz
mpd-9eed41911f5b65bb51d2395388439918e799cade.tar.xz
mpd-9eed41911f5b65bb51d2395388439918e799cade.zip
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.
Diffstat (limited to 'src/decoder/mp4_plugin.c')
-rw-r--r--src/decoder/mp4_plugin.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/decoder/mp4_plugin.c b/src/decoder/mp4_plugin.c
index eee441951..2736d3059 100644
--- a/src/decoder/mp4_plugin.c
+++ b/src/decoder/mp4_plugin.c
@@ -90,7 +90,7 @@ mp4_seek(void *user_data, uint64_t position)
? 0 : -1;
}
-static bool
+static void
mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
{
struct mp4_context ctx = {
@@ -133,14 +133,14 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
mp4fh = mp4ff_open_read(&callback);
if (!mp4fh) {
g_warning("Input does not appear to be a mp4 stream.\n");
- return false;
+ return;
}
track = mp4_get_aac_track(mp4fh);
if (track < 0) {
g_warning("No AAC track found in mp4 stream.\n");
mp4ff_close(mp4fh);
- return false;
+ return;
}
decoder = faacDecOpen();
@@ -164,7 +164,7 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
g_warning("Not an AAC stream.\n");
faacDecClose(decoder);
mp4ff_close(mp4fh);
- return false;
+ return;
}
file_time = mp4ff_get_track_duration_use_offsets(mp4fh, track);
@@ -176,7 +176,7 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
g_warning("Error getting audio format of mp4 AAC track.\n");
faacDecClose(decoder);
mp4ff_close(mp4fh);
- return false;
+ return;
}
total_time = ((float)file_time) / scale;
@@ -185,7 +185,7 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
g_warning("Integer overflow.\n");
faacDecClose(decoder);
mp4ff_close(mp4fh);
- return false;
+ return;
}
file_time = 0.0;
@@ -299,14 +299,6 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
free(seek_table);
faacDecClose(decoder);
mp4ff_close(mp4fh);
-
- if (!initialized)
- return false;
-
- if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK && seeking)
- decoder_command_finished(mpd_decoder);
-
- return true;
}
static struct tag *