summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-08-18 02:07:36 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-08-18 02:07:36 +0200
commitb3e73d2747b986bfc40aa10832e2345866faa811 (patch)
treed363d9256a8fbe3985c00423f505a02820e147af
parent074d8c34fd299d2368f748375ddcce81d8eeb8dc (diff)
Use encoder_get() in commands.c.
-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: