diff options
author | Max Kellermann <max@duempel.org> | 2008-11-10 15:07:01 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-10 15:07:01 +0100 |
commit | ff1acefb2115252cb27f0d0dc6219a527e258049 (patch) | |
tree | f264bf133731dfb33d0da8bb3438351f6bed570a /src/decoder_thread.c | |
parent | 10eea9d9815c37077d0d0bde98ae4daeed3d101b (diff) | |
download | mpd-ff1acefb2115252cb27f0d0dc6219a527e258049.tar.gz mpd-ff1acefb2115252cb27f0d0dc6219a527e258049.tar.xz mpd-ff1acefb2115252cb27f0d0dc6219a527e258049.zip |
decoder: removed plugin method try_decode()
Instead of having a seprate try_decode() method, let the
stream_decode() and file_decode() methods decide whether they are able
to decode the song.
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r-- | src/decoder_thread.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c index a50dbf8d2..99c76f892 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -29,23 +29,6 @@ #include "ls.h" static bool -decoder_try_decode(const struct decoder_plugin *plugin, - struct input_stream *input_stream) -{ - bool ret; - - if (plugin->try_decode == NULL) - return true; - - ret = plugin->try_decode(input_stream); - - /* rewind the stream, so the next reader gets a fresh start */ - input_stream_seek(input_stream, 0, SEEK_SET); - - return ret; -} - -static bool decoder_stream_decode(const struct decoder_plugin *plugin, struct decoder *decoder, struct input_stream *input_stream) @@ -172,8 +155,6 @@ static void decoder_run(void) while ((plugin = decoder_plugin_from_mime_type(input_stream.mime, next++))) { if (plugin->stream_decode == NULL) continue; - if (!decoder_try_decode(plugin, &input_stream)) - continue; ret = decoder_stream_decode(plugin, &decoder, &input_stream); if (ret) @@ -189,8 +170,6 @@ static void decoder_run(void) while ((plugin = decoder_plugin_from_suffix(s, next++))) { if (plugin->stream_decode == NULL) continue; - if (!decoder_try_decode(plugin, &input_stream)) - continue; ret = decoder_stream_decode(plugin, &decoder, &input_stream); if (ret) @@ -215,9 +194,6 @@ static void decoder_run(void) unsigned int next = 0; const char *s = getSuffix(uri); while ((plugin = decoder_plugin_from_suffix(s, next++))) { - if (!decoder_try_decode(plugin, &input_stream)) - continue; - if (plugin->file_decode != NULL) { input_stream_close(&input_stream); close_instream = false; |