diff options
author | Max Kellermann <max@duempel.org> | 2008-11-04 17:10:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-04 17:10:19 +0100 |
commit | 85a7d1a1487dd29705b6df5175727d565350c784 (patch) | |
tree | ffc41cf98b259576d938c2152809f37ffae24ba5 | |
parent | 59c20e5afe8449204298c7d801b93636be237b4d (diff) | |
download | mpd-85a7d1a1487dd29705b6df5175727d565350c784.tar.gz mpd-85a7d1a1487dd29705b6df5175727d565350c784.tar.xz mpd-85a7d1a1487dd29705b6df5175727d565350c784.zip |
decoder: removed stream_types
Instead of checking the stream_types bit set, we can simply check
whether the methods stream_decode() and file_decode() are implemented.
Diffstat (limited to '')
-rw-r--r-- | src/decoder/aac_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/audiofile_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/ffmpeg_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/flac_plugin.c | 2 | ||||
-rw-r--r-- | src/decoder/mod_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/mp3_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/mp4_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/mpc_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/oggflac_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/oggvorbis_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder/wavpack_plugin.c | 1 | ||||
-rw-r--r-- | src/decoder_api.h | 8 | ||||
-rw-r--r-- | src/decoder_thread.c | 8 |
13 files changed, 0 insertions, 28 deletions
diff --git a/src/decoder/aac_plugin.c b/src/decoder/aac_plugin.c index 7961865b2..81ad90e69 100644 --- a/src/decoder/aac_plugin.c +++ b/src/decoder/aac_plugin.c @@ -579,7 +579,6 @@ const struct decoder_plugin aacPlugin = { .stream_decode = aac_stream_decode, .file_decode = aac_decode, .tag_dup = aacTagDup, - .stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL, .suffixes = aac_suffixes, .mime_types = aac_mimeTypes }; diff --git a/src/decoder/audiofile_plugin.c b/src/decoder/audiofile_plugin.c index 3c702efe6..637478819 100644 --- a/src/decoder/audiofile_plugin.c +++ b/src/decoder/audiofile_plugin.c @@ -141,6 +141,5 @@ const struct decoder_plugin audiofilePlugin = { .name = "audiofile", .file_decode = audiofile_decode, .tag_dup = audiofileTagDup, - .stream_types = INPUT_PLUGIN_STREAM_FILE, .suffixes = audiofileSuffixes, }; diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c index 19faeb1cd..41eb4b4d3 100644 --- a/src/decoder/ffmpeg_plugin.c +++ b/src/decoder/ffmpeg_plugin.c @@ -373,7 +373,6 @@ const struct decoder_plugin ffmpeg_plugin = { .try_decode = ffmpeg_try_decode, .stream_decode = ffmpeg_decode, .tag_dup = ffmpeg_tag, - .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = ffmpeg_suffixes, .mime_types = ffmpeg_mime_types }; diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c index f3aaf42c6..1deba8ad7 100644 --- a/src/decoder/flac_plugin.c +++ b/src/decoder/flac_plugin.c @@ -443,7 +443,6 @@ const struct decoder_plugin oggflacPlugin = { .try_decode = oggflac_try_decode, .stream_decode = oggflac_decode, .tag_dup = oggflac_tag_dup, - .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = oggflac_suffixes, .mime_types = oggflac_mime_types }; @@ -459,7 +458,6 @@ const struct decoder_plugin flacPlugin = { .name = "flac", .stream_decode = flac_decode, .tag_dup = flacTagDup, - .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = flacSuffixes, .mime_types = flac_mime_types }; diff --git a/src/decoder/mod_plugin.c b/src/decoder/mod_plugin.c index 5f3dbb191..6e21a13eb 100644 --- a/src/decoder/mod_plugin.c +++ b/src/decoder/mod_plugin.c @@ -260,6 +260,5 @@ const struct decoder_plugin modPlugin = { .finish = mod_finishMikMod, .file_decode = mod_decode, .tag_dup = modTagDup, - .stream_types = INPUT_PLUGIN_STREAM_FILE, .suffixes = modSuffixes, }; diff --git a/src/decoder/mp3_plugin.c b/src/decoder/mp3_plugin.c index f3edf9d20..cf46ac166 100644 --- a/src/decoder/mp3_plugin.c +++ b/src/decoder/mp3_plugin.c @@ -1115,7 +1115,6 @@ const struct decoder_plugin mp3Plugin = { .init = mp3_plugin_init, .stream_decode = mp3_decode, .tag_dup = mp3_tag_dup, - .stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL, .suffixes = mp3_suffixes, .mime_types = mp3_mime_types }; diff --git a/src/decoder/mp4_plugin.c b/src/decoder/mp4_plugin.c index f5a61fe03..eee441951 100644 --- a/src/decoder/mp4_plugin.c +++ b/src/decoder/mp4_plugin.c @@ -417,7 +417,6 @@ const struct decoder_plugin mp4_plugin = { .name = "mp4", .stream_decode = mp4_decode, .tag_dup = mp4_tag_dup, - .stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL, .suffixes = mp4_suffixes, .mime_types = mp4_mime_types, }; diff --git a/src/decoder/mpc_plugin.c b/src/decoder/mpc_plugin.c index 510433d13..a9917d9f9 100644 --- a/src/decoder/mpc_plugin.c +++ b/src/decoder/mpc_plugin.c @@ -301,6 +301,5 @@ const struct decoder_plugin mpcPlugin = { .name = "mpc", .stream_decode = mpc_decode, .tag_dup = mpcTagDup, - .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = mpcSuffixes, }; diff --git a/src/decoder/oggflac_plugin.c b/src/decoder/oggflac_plugin.c index 412de7081..c117cf3d2 100644 --- a/src/decoder/oggflac_plugin.c +++ b/src/decoder/oggflac_plugin.c @@ -346,7 +346,6 @@ const struct decoder_plugin oggflacPlugin = { .try_decode = oggflac_try_decode, .stream_decode = oggflac_decode, .tag_dup = oggflac_TagDup, - .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = oggflac_Suffixes, .mime_types = oggflac_mime_types }; diff --git a/src/decoder/oggvorbis_plugin.c b/src/decoder/oggvorbis_plugin.c index f86bf3fc4..32660c2c0 100644 --- a/src/decoder/oggvorbis_plugin.c +++ b/src/decoder/oggvorbis_plugin.c @@ -370,7 +370,6 @@ const struct decoder_plugin oggvorbisPlugin = { .try_decode = oggvorbis_try_decode, .stream_decode = oggvorbis_decode, .tag_dup = oggvorbis_TagDup, - .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = oggvorbis_Suffixes, .mime_types = oggvorbis_MimeTypes }; diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c index 977ab973d..18073c070 100644 --- a/src/decoder/wavpack_plugin.c +++ b/src/decoder/wavpack_plugin.c @@ -539,7 +539,6 @@ const struct decoder_plugin wavpack_plugin = { .stream_decode = wavpack_streamdecode, .file_decode = wavpack_filedecode, .tag_dup = wavpack_tagdup, - .stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL, .suffixes = wavpack_suffixes, .mime_types = wavpack_mime_types }; diff --git a/src/decoder_api.h b/src/decoder_api.h index 486712d99..f4ef49525 100644 --- a/src/decoder_api.h +++ b/src/decoder_api.h @@ -35,11 +35,6 @@ #include <stdbool.h> -/* valid values for streamTypes in the InputPlugin struct: */ -#define INPUT_PLUGIN_STREAM_FILE 0x01 -#define INPUT_PLUGIN_STREAM_URL 0x02 - - enum decoder_command { DECODE_COMMAND_NONE = 0, DECODE_COMMAND_START, @@ -94,9 +89,6 @@ struct decoder_plugin { */ struct tag *(*tag_dup)(const char *file); - /* one or more of the INPUT_PLUGIN_STREAM_* values OR'd together */ - unsigned char stream_types; - /* last element in these arrays must always be a NULL: */ const char *const*suffixes; const char *const*mime_types; diff --git a/src/decoder_thread.c b/src/decoder_thread.c index 7c6f649a3..a468f1069 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -108,8 +108,6 @@ static void decoder_run(void) while ((plugin = decoder_plugin_from_mime_type(input_stream.mime, next++))) { if (plugin->stream_decode == NULL) continue; - if (!(plugin->stream_types & INPUT_PLUGIN_STREAM_URL)) - continue; if (!decoder_try_decode(plugin, &input_stream)) continue; ret = plugin->stream_decode(&decoder, &input_stream); @@ -123,9 +121,6 @@ static void decoder_run(void) while ((plugin = decoder_plugin_from_suffix(s, next++))) { if (plugin->stream_decode == NULL) continue; - if (!(plugin->stream_types & - INPUT_PLUGIN_STREAM_URL)) - continue; if (!decoder_try_decode(plugin, &input_stream)) continue; decoder.plugin = plugin; @@ -150,9 +145,6 @@ static void decoder_run(void) unsigned int next = 0; const char *s = getSuffix(uri); while ((plugin = decoder_plugin_from_suffix(s, next++))) { - if (!plugin->stream_types & INPUT_PLUGIN_STREAM_FILE) - continue; - if (!decoder_try_decode(plugin, &input_stream)) continue; |