From ff1acefb2115252cb27f0d0dc6219a527e258049 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 10 Nov 2008 15:07:01 +0100 Subject: 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. --- src/decoder_thread.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/decoder_thread.c') 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 @@ -28,23 +28,6 @@ #include "log.h" #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, @@ -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; -- cgit v1.2.3