diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-18 02:07:36 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-18 02:07:36 +0200 |
commit | b3e73d2747b986bfc40aa10832e2345866faa811 (patch) | |
tree | d363d9256a8fbe3985c00423f505a02820e147af | |
parent | 074d8c34fd299d2368f748375ddcce81d8eeb8dc (diff) |
Use encoder_get() in commands.c.
-rw-r--r-- | commands.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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: |