Commit 5287bbdd authored by Moritz Grimm's avatar Moritz Grimm
Browse files

Support pass-through encoder (again)

parent b7d12699
......@@ -179,8 +179,6 @@ _build_reencode_cmd(const char *extension, const char *filename,
dicts[4].from = PLACEHOLDER_METADATA;
dicts[4].to = custom_songinfo;
dec_str = util_expand_words(cfg_decoder_get_program(decoder), dicts);
if (!cfg_get_metadata_program() &&
strstr(cfg_encoder_get_program(encoder),
PLACEHOLDER_TITLE) != NULL) {
......@@ -188,13 +186,21 @@ _build_reencode_cmd(const char *extension, const char *filename,
dicts[4].to = custom_songinfo = xstrdup("");
}
enc_str = util_expand_words(cfg_encoder_get_program(encoder), dicts);
cmd_str_size = strlen(dec_str) + strlen(" | ") + strlen(enc_str) + 1;
cmd_str = xcalloc(cmd_str_size, sizeof(char));
snprintf(cmd_str, cmd_str_size, "%s | %s", dec_str, enc_str);
xfree(dec_str);
xfree(enc_str);
dec_str = util_expand_words(cfg_decoder_get_program(decoder), dicts);
cmd_str_size = strlen(dec_str) + 1;
if (cfg_encoder_get_program(encoder)) {
enc_str = util_expand_words(cfg_encoder_get_program(encoder),
dicts);
cmd_str_size += strlen(" | ") + strlen(enc_str);
cmd_str = xcalloc(cmd_str_size, sizeof(char));
snprintf(cmd_str, cmd_str_size, "%s | %s", dec_str, enc_str);
xfree(enc_str);
xfree(dec_str);
} else {
cmd_str = xcalloc(cmd_str_size, sizeof(char));
snprintf(cmd_str, cmd_str_size, "%s", dec_str);
xfree(dec_str);
}
xfree(artist);
xfree(album);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment