aboutsummaryrefslogtreecommitdiffstats
path: root/src/lyrics.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-12 19:59:40 +0100
committerMax Kellermann <max@duempel.org>2008-12-12 19:59:40 +0100
commitdf9c61571a6f18bf410bab23d442cfc85cbced17 (patch)
tree9162d29467145f924586f7054affa617432e787c /src/lyrics.c
parent196c22ca88fbe005aba1fdf6dffe2343231757eb (diff)
downloadmpd-df9c61571a6f18bf410bab23d442cfc85cbced17.tar.gz
mpd-df9c61571a6f18bf410bab23d442cfc85cbced17.tar.xz
mpd-df9c61571a6f18bf410bab23d442cfc85cbced17.zip
lyrics: return plugin_cycle struct
Eliminated the lyrics_loader struct. Instead of lyrics_free(), callers should use plugin_stop().
Diffstat (limited to 'src/lyrics.c')
-rw-r--r--src/lyrics.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/lyrics.c b/src/lyrics.c
index 052af4e8a..1b33542d4 100644
--- a/src/lyrics.c
+++ b/src/lyrics.c
@@ -23,10 +23,6 @@
static struct plugin_list plugins;
-struct lyrics_loader {
- struct plugin_cycle *plugin;
-};
-
void lyrics_init(void)
{
plugin_list_init(&plugins);
@@ -38,25 +34,14 @@ void lyrics_deinit(void)
plugin_list_deinit(&plugins);
}
-struct lyrics_loader *
+struct plugin_cycle *
lyrics_load(const char *artist, const char *title,
plugin_callback_t callback, void *data)
{
- struct lyrics_loader *loader = g_new(struct lyrics_loader, 1);
const char *args[3] = { artist, title, NULL };
assert(artist != NULL);
assert(title != NULL);
- loader->plugin = plugin_run(&plugins, args,
- callback, data);
-
- return loader;
-}
-
-void
-lyrics_free(struct lyrics_loader *loader)
-{
- plugin_stop(loader->plugin);
- g_free(loader);
+ return plugin_run(&plugins, args, callback, data);
}