From 166d04c9ec72499ef1d4f3f596db4f8179ba33b2 Mon Sep 17 00:00:00 2001 From: Julian Rother <julianr@fsmpi.rwth-aachen.de> Date: Sun, 18 Nov 2018 20:27:07 +0100 Subject: [PATCH] transcode: Hopefully fixed last commit --- transcode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/transcode.c b/transcode.c index fd8da34..8a03022 100644 --- a/transcode.c +++ b/transcode.c @@ -250,7 +250,7 @@ void connect_pads(AVFilterInOut **ins, AVFilterInOut **outs) int main(int argc, char *argv[]) { int err, i, progress, _progress, canceled; - char *p, *input, *output, *inpath, *outpath, *tmppath, *oldsrcpath; + char *p, *input, *output, *inpath, *outdir, *outpath, *tmppath, *oldsrcpath; AVFormatContext *demux, *mux; AVCodecContext **decs, **encs; AVFilterContext **srcs, **sinks; @@ -276,6 +276,9 @@ int main(int argc, char *argv[]) input = jlookup(argv[4], "input"); inpath = buildpath(getenv(WORKER_RAW), jstr(jlookup(input, "path"), 0)); output = jlookup(argv[4], "output"); + outdir = buildpath(getenv(WORKER_RELEASED), dirname(jstr(jlookup(output, "path"), 0))); + if (access(outdir, F_OK) && mkdir(outdir, 02775)) + job_failed("Could not create target directory \"%s\": %s", outdir, strerror(errno)); outpath = buildpath(getenv(WORKER_RELEASED), jstr(jlookup(output, "path"), 0)); tmppath = mprintf("%s/.tmp-%i", getenv(WORKER_TMP), jobid); if (oldsrcpath = jstr(jlookup(argv[4], "srcpath"), 0)) @@ -283,8 +286,6 @@ int main(int argc, char *argv[]) else oldsrcpath = "/var/empty/nosource"; overwrite_check(outpath, oldsrcpath, jstr(jlookup(argv[4], "srchash"), "")); - if (access(dirname(outpath), F_OK) && mkdir(dirname(outpath), 02775)) - job_failed("Could not create target directory \"%s\": %s", dirname(outpath), strerror(errno)); demux = 0; opts = 0; parse_dict(&opts, jlookup(input, "options")); -- GitLab