Skip to content
Snippets Groups Projects
Commit b8297817 authored by Julian Rother's avatar Julian Rother
Browse files

transcode: Create destination directory if necessary

parent 7ad7adeb
No related branches found
No related tags found
No related merge requests found
Pipeline #452 passed
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <libgen.h>
#include <libavutil/opt.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
......@@ -281,7 +283,8 @@ 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"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment