aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/mikmod_decoder_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-11 19:26:41 +0100
committerMax Kellermann <max@duempel.org>2012-02-11 19:28:56 +0100
commitee16fc958c70946f934a86b040e8b6dc70ec0b2b (patch)
tree1ffb4a14ca051d977d696e7af24fa847f149ee55 /src/decoder/mikmod_decoder_plugin.c
parent5d73215a8dad922c8e383f3837f3ec9e26503389 (diff)
downloadmpd-ee16fc958c70946f934a86b040e8b6dc70ec0b2b.tar.gz
mpd-ee16fc958c70946f934a86b040e8b6dc70ec0b2b.tar.xz
mpd-ee16fc958c70946f934a86b040e8b6dc70ec0b2b.zip
decoder/{mikmod,fluidsynth,mp4ff}: adapt to tag_handler API
Fixes build regression.
Diffstat (limited to 'src/decoder/mikmod_decoder_plugin.c')
-rw-r--r--src/decoder/mikmod_decoder_plugin.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/decoder/mikmod_decoder_plugin.c b/src/decoder/mikmod_decoder_plugin.c
index 9dd5a79b6..5681a7a57 100644
--- a/src/decoder/mikmod_decoder_plugin.c
+++ b/src/decoder/mikmod_decoder_plugin.c
@@ -20,6 +20,7 @@
#include "config.h"
#include "decoder_api.h"
#include "mpd_error.h"
+#include "tag_handler.h"
#include <glib.h>
#include <mikmod.h>
@@ -177,8 +178,9 @@ mikmod_decoder_file_decode(struct decoder *decoder, const char *path_fs)
Player_Free(handle);
}
-static struct tag *
-mikmod_decoder_tag_dup(const char *path_fs)
+static bool
+mikmod_decoder_scan_file(const char *path_fs,
+ const struct tag_handler *handler, void *handler_ctx)
{
char *path2 = g_strdup(path_fs);
MODULE *handle = Player_Load(path2, 128, 0);
@@ -186,25 +188,22 @@ mikmod_decoder_tag_dup(const char *path_fs)
if (handle == NULL) {
g_free(path2);
g_debug("Failed to open file: %s", path_fs);
- return NULL;
+ return false;
}
Player_Free(handle);
- struct tag *tag = tag_new();
-
- tag->time = 0;
-
char *title = Player_LoadTitle(path2);
g_free(path2);
if (title != NULL) {
- tag_add_item(tag, TAG_TITLE, title);
+ tag_handler_invoke_tag(handler, handler_ctx,
+ TAG_TITLE, title);
free(title);
}
- return tag;
+ return true;
}
static const char *const mikmod_decoder_suffixes[] = {
@@ -231,6 +230,6 @@ const struct decoder_plugin mikmod_decoder_plugin = {
.init = mikmod_decoder_init,
.finish = mikmod_decoder_finish,
.file_decode = mikmod_decoder_file_decode,
- .tag_dup = mikmod_decoder_tag_dup,
+ .scan_file = mikmod_decoder_scan_file,
.suffixes = mikmod_decoder_suffixes,
};