summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commands.c9
1 files changed, 7 insertions, 2 deletions
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: