aboutsummaryrefslogtreecommitdiff
path: root/src/VideoPlayer.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-23 05:12:53 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-23 05:12:53 +0200
commita9219531c2e286f65b3a1d137f61b72987b960b1 (patch)
treec9a85d61dbc1a6135411bc61039dbbbcd191b973 /src/VideoPlayer.cpp
parentbd1c52d14338775b6e6b1da0cb6fd064fa3c4ad2 (diff)
Only use x11egl mpv option when running wayland. Disable video disk cache, use mpv default instead
Diffstat (limited to 'src/VideoPlayer.cpp')
-rw-r--r--src/VideoPlayer.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index fd5ba79..9dbbe85 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -1,6 +1,7 @@
#include "../include/VideoPlayer.hpp"
#include "../include/Storage.hpp"
#include "../include/Program.hpp"
+#include "../include/Utils.hpp"
#include <string>
#include <json/reader.h>
#include <json/writer.h>
@@ -97,9 +98,9 @@ namespace QuickMedia {
wid_arg += parent_window_str;
std::string input_conf = "--input-conf=" + resource_root + "input.conf";
- Path video_cache_dir = get_cache_dir().join("video");
- create_directory_recursive(video_cache_dir);
- std::string cache_dir = "--cache-dir=" + video_cache_dir.data;
+ //Path video_cache_dir = get_cache_dir().join("video");
+ //create_directory_recursive(video_cache_dir);
+ //std::string cache_dir = "--cache-dir=" + video_cache_dir.data;
Path mpv_watch_later_dir = get_storage_dir().join("mpv").join("watch_later");
create_directory_recursive(mpv_watch_later_dir);
@@ -121,19 +122,23 @@ namespace QuickMedia {
"--no-terminal",
"--save-position-on-quit=yes",
"--profile=pseudo-gui", // For gui when playing audio, requires a version of mpv that isn't ancient
- cache_dir.c_str(),
+ //cache_dir.c_str(),
watch_later_dir.c_str(),
- "--cache-on-disk=yes",
+ //"--cache-on-disk=yes",
ytdl_format.c_str(),
// TODO: Disable hr seek on low power devices?
"--hr-seek=yes",
- "--gpu-context=x11egl",
"--cookies",
cookies_file_arg.c_str(),
input_conf.c_str(),
wid_arg.c_str()
});
+ if(is_running_wayland()) {
+ args.push_back("--gpu-context=x11egl");
+ fprintf(stderr, "Wayland detected. Launching mpv in x11egl mode\n");
+ }
+
if(keep_open)
args.push_back("--keep-open=yes");