summaryrefslogtreecommitdiffstats
path: root/osdep/path.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-05-02 19:29:27 -0500
committerDudemanguy <random342@airmail.cc>2023-05-09 20:37:17 +0000
commit7c4c9bc86f55f4d1224814fbeafdee8f1c3c3108 (patch)
tree049c5f74a1380fd5de1c1911a4829103c875d146 /osdep/path.h
parent5158b85b21b9316b610ab59ba65da36144e03b9a (diff)
downloadmpv-7c4c9bc86f55f4d1224814fbeafdee8f1c3c3108.tar.bz2
mpv-7c4c9bc86f55f4d1224814fbeafdee8f1c3c3108.tar.xz
player: use XDG_STATE_HOME for watch_later
A pain point for some users is the fact that watch_later is stored in the ~/.config directory when it's really not configuration data. Roughly 2 years ago, XDG_STATE_DIR was added to the XDG Base Directory Specification[0] and its description, user-specific state data, actually perfectly matches what watch_later data is for. Let's go ahead and use this directory as the default for watch_later. This change only affects non-darwin unix-like systems (i.e. Linux, BSDs, etc.). The directory doesn't move for anyone else. Internally, quite a few things change with regards to the path selection. If the platform in question does not have a statedir concept, then the path selection will simply return "home" instead (old behavior). Fixes #9147. [0]: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/4f2884e16db35f2962d9b64312917c81be5cb54b
Diffstat (limited to 'osdep/path.h')
-rw-r--r--osdep/path.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/osdep/path.h b/osdep/path.h
index 43b9d63bbe..d678b12072 100644
--- a/osdep/path.h
+++ b/osdep/path.h
@@ -11,6 +11,12 @@
// "global" the least priority, global config file location
// "desktop" path to desktop contents
//
+// These additional types are also defined. However, they are not necessarily
+// implemented on every platform. Unlike some other type values that are
+// platform specific (like "osxbundle"), the value of "home" is returned
+// instead if these types are not explicitly defined.
+// "state" the native mpv-specific user state dir
+//
// It is allowed to return a static string, so the caller must set talloc_ctx
// to something other than NULL to avoid memory leaks.
typedef const char *(*mp_get_platform_path_cb)(void *talloc_ctx, const char *type);