From b3e73d2747b986bfc40aa10832e2345866faa811 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 18 Aug 2010 02:07:36 +0200 Subject: Use encoder_get() in commands.c. --- commands.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index 38d760f..5a2230f 100644 --- a/commands.c +++ b/commands.c @@ -198,7 +198,7 @@ static void commands_get_mp3(GSocketConnection *connection, const gchar *cmd) { g_string_free(string, TRUE); const struct decoder_plugin *decoder = decoder_find(path); - extern const struct encoder_plugin encoder_lame_encoder; + const struct encoder_plugin *encoder = encoder_get("lame"); if(decoder == NULL) { g_warning("no suitable decoder found"); @@ -207,7 +207,12 @@ static void commands_get_mp3(GSocketConnection *connection, const gchar *cmd) { g_debug("using decoder %s", decoder->name); } - transcode((GInputStream*)is, decoder, os, &encoder_lame_encoder); + if(encoder == NULL) { + g_warning("no encoder found"); + goto commands_get_mp3_file_unref; + } + + transcode((GInputStream*)is, decoder, os, encoder); commands_get_mp3_file_unref: -- cgit v1.2.3