diff options
author | Max Kellermann <max@duempel.org> | 2009-12-31 17:18:10 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-31 18:27:48 +0100 |
commit | 6b96f5d566a6a36bfcdb70c8a27771717eb3d038 (patch) | |
tree | 4792f3d8f9e16c3ba3416e46cc613e7457428cde /src/decoder | |
parent | 7a2e07e124ebaae8ecc55de6ea24cbb10c32cebd (diff) | |
download | mpd-6b96f5d566a6a36bfcdb70c8a27771717eb3d038.tar.gz mpd-6b96f5d566a6a36bfcdb70c8a27771717eb3d038.tar.xz mpd-6b96f5d566a6a36bfcdb70c8a27771717eb3d038.zip |
decoder_plugin: added method stream_tag()
This is like tag_dup(), but works with an input_stream object instead
of a file path.
Diffstat (limited to '')
-rw-r--r-- | src/decoder/sidplay_plugin.cxx | 1 | ||||
-rw-r--r-- | src/decoder_plugin.h | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/decoder/sidplay_plugin.cxx b/src/decoder/sidplay_plugin.cxx index 9bfe98f3d..79cd9cb03 100644 --- a/src/decoder/sidplay_plugin.cxx +++ b/src/decoder/sidplay_plugin.cxx @@ -411,6 +411,7 @@ const struct decoder_plugin sidplay_decoder_plugin = { NULL, /* stream_decode() */ sidplay_file_decode, sidplay_tag_dup, + NULL, /* stream_tag() */ sidplay_container_scan, sidplay_suffixes, NULL, /* mime_types */ diff --git a/src/decoder_plugin.h b/src/decoder_plugin.h index a078540a6..3f0fde3d8 100644 --- a/src/decoder_plugin.h +++ b/src/decoder_plugin.h @@ -77,6 +77,13 @@ struct decoder_plugin { struct tag *(*tag_dup)(const char *path_fs); /** + * Read the tags of a stream. + * + * @return NULL if the operation has failed + */ + struct tag *(*stream_tag)(struct input_stream *is); + + /** * @brief Return a "virtual" filename for subtracks in * container formats like flac * @param const char* pathname full pathname for the file on fs @@ -147,7 +154,21 @@ static inline struct tag * decoder_plugin_tag_dup(const struct decoder_plugin *plugin, const char *path_fs) { - return plugin->tag_dup(path_fs); + return plugin->tag_dup != NULL + ? plugin->tag_dup(path_fs) + : NULL; +} + +/** + * Read the tag of a stream. + */ +static inline struct tag * +decoder_plugin_stream_tag(const struct decoder_plugin *plugin, + struct input_stream *is) +{ + return plugin->stream_tag != NULL + ? plugin->stream_tag(is) + : NULL; } /** |