diff options
author | 2012-04-08 14:22:46 +0200 | |
---|---|---|
committer | 2012-04-08 14:22:46 +0200 | |
commit | 8ea040c539bb7a7d5da19559e744d6c70f2993d2 (patch) | |
tree | 38dc1088674df26350c5bdd2c46a786d3db03835 /plugins/converter/converter.c | |
parent | 3a669ae3939bd0350880233cc37758c6ef27ef73 (diff) |
converter: added reconstruction of folder structure based on the largest common root
Diffstat (limited to 'plugins/converter/converter.c')
-rw-r--r-- | plugins/converter/converter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c index bdeab06a..62cbcf39 100644 --- a/plugins/converter/converter.c +++ b/plugins/converter/converter.c @@ -746,7 +746,7 @@ convert (DB_playItem_t *it, const char *outfolder, const char *outfile, int outp return -1; } - char *path = outfolder[0] ? strdupa (outfolder) : strdupa (getenv("HOME")); + char *path = preserve_folder_structure ? strdupa (root_folder) : (outfolder[0] ? strdupa (outfolder) : strdupa (getenv("HOME"))); if (!check_dir (path, 0755)) { fprintf (stderr, "converter: failed to create output folder: %s\n", outfolder); return -1; @@ -775,7 +775,7 @@ convert (DB_playItem_t *it, const char *outfolder, const char *outfile, int outp output_is_float = fileinfo->fmt.is_float; } - get_output_path (it, outfolder, outfile, encoder_preset, out, sizeof (out)); + get_output_path (it, preserve_folder_structure ? root_folder : outfolder, outfile, encoder_preset, out, sizeof (out)); if (encoder_preset->method == DDB_ENCODER_METHOD_FILE) { const char *tmp = getenv ("TMPDIR"); if (!tmp) { |