Commit 680d2f9b authored by Stefan Westerfeld's avatar Stefan Westerfeld

HLS: hls-prepare: create output directory if it doesn't exist

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 218489d2
......@@ -329,6 +329,13 @@ hls_prepare (const string& in_dir, const string& out_dir, const string& filename
return 1;
}
int mkret = mkdir (out_dir.c_str(), 0755);
if (mkret == -1 && errno != EEXIST)
{
error ("audiowmark: unable to create directory %s: %s\n", out_dir.c_str(), strerror (errno));
return 1;
}
string out_name = out_dir + "/" + filename;
FILE *out_file = fopen (out_name.c_str(), "w");
ScopedFile out_file_s (out_file);
......
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