summaryrefslogtreecommitdiffstats
path: root/mpvcore/path.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-29 22:38:29 +0100
committerwm4 <wm4@nowhere>2013-10-30 01:53:53 +0100
commitb19414f3bf0ae28461ef6d5048e9626e69d45319 (patch)
tree585f81a52da4ff5a8c4f7cd52275040211994d7c /mpvcore/path.c
parenta84258d769a3d06958a017bb3fc47521ade5751b (diff)
downloadmpv-b19414f3bf0ae28461ef6d5048e9626e69d45319.tar.bz2
mpv-b19414f3bf0ae28461ef6d5048e9626e69d45319.tar.xz
Split mplayer.c
mplayer.c was a bit too big. Split it into multiple files. I hope the way it's split makes sense. Maybe some things don't make too much sense, or go against intuition. These will fixed as soon as I notice them. Some files are a bit questionable (misc.c, osd.c, configfiles.c), and suggestions how to organize this better are welcome. Regressions are possible due to reorganized include statements. Obviously I didn't just copy mplayer.c's orgy of include statements, but recreated them for each file. It's easily possible that there are oversights and mistakes, which will show up on other platforms. There is one actual change: the public avutil.h include is removed from encode.h, and I tried to replace most FFMIN/FFMAX/av_clip uses. I consider using libavutil too much as dangerous, because the set of include files they recursively pull in is rather arbitrary and is different between FFmpeg and Libav.
Diffstat (limited to 'mpvcore/path.c')
-rw-r--r--mpvcore/path.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mpvcore/path.c b/mpvcore/path.c
index 647693fb05..93e2d09b04 100644
--- a/mpvcore/path.c
+++ b/mpvcore/path.c
@@ -202,3 +202,15 @@ bool mp_is_url(bstr path)
}
return true;
}
+
+void mp_mk_config_dir(char *subdir)
+{
+ void *tmp = talloc_new(NULL);
+ char *confdir = talloc_steal(tmp, mp_find_user_config_file(""));
+ if (confdir) {
+ if (subdir)
+ confdir = mp_path_join(tmp, bstr0(confdir), bstr0(subdir));
+ mkdir(confdir, 0777);
+ }
+ talloc_free(tmp);
+}