From 5f64e5a2eef0c415e218d71877fe4936a93589f4 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 19 Oct 2018 20:47:56 +0200 Subject: [PATCH] Create frames/ if it does not exist. --- main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.cpp b/main.cpp index bf97575..04a7d54 100644 --- a/main.cpp +++ b/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,17 @@ int main(int argc, char **argv) exit(1); } + string frame_dir = global_flags.working_directory + "/frames"; + + struct stat st; + if (stat(frame_dir.c_str(), &st) == -1) { + fprintf(stderr, "%s does not exist, creating it.\n", frame_dir.c_str()); + if (mkdir(frame_dir.c_str(), 0777) == -1) { + perror(global_flags.working_directory.c_str()); + exit(1); + } + } + avformat_network_init(); global_httpd = new HTTPD; -- 2.39.2