Commit b8297817 authored by Julian Rother's avatar Julian Rother

transcode: Create destination directory if necessary

parent 7ad7adeb
Pipeline #452 passed with stage
in 6 minutes and 27 seconds
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include <libgen.h>
#include <libavutil/opt.h> #include <libavutil/opt.h>
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
...@@ -281,7 +283,8 @@ int main(int argc, char *argv[]) ...@@ -281,7 +283,8 @@ int main(int argc, char *argv[])
else else
oldsrcpath = "/var/empty/nosource"; oldsrcpath = "/var/empty/nosource";
overwrite_check(outpath, oldsrcpath, jstr(jlookup(argv[4], "srchash"), "")); 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; demux = 0;
opts = 0; opts = 0;
parse_dict(&opts, jlookup(input, "options")); parse_dict(&opts, jlookup(input, "options"));
......
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