aboutsummaryrefslogtreecommitdiff
path: root/src/VideoPlayer.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-06-28 00:03:27 +0200
committerdec05eba <dec05eba@protonmail.com>2020-06-28 00:03:27 +0200
commit52d2bcde946b4cc05932db347bce44d2fd518865 (patch)
treed67f8dcff6cfd44823834571cad1c5fc2ed487de /src/VideoPlayer.cpp
parentdd7f669c797d8bf844140001a094f87f28188351 (diff)
Add --use-system-mpv-config option
Diffstat (limited to 'src/VideoPlayer.cpp')
-rw-r--r--src/VideoPlayer.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 85c0d4d..138f269 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -17,8 +17,9 @@ const int MAX_RETRIES_CONNECT = 20;
const int READ_TIMEOUT_MS = 200;
namespace QuickMedia {
- VideoPlayer::VideoPlayer(bool use_tor, EventCallbackFunc _event_callback, VideoPlayerWindowCreateCallback _window_create_callback) :
+ VideoPlayer::VideoPlayer(bool use_tor, bool use_system_mpv_config, EventCallbackFunc _event_callback, VideoPlayerWindowCreateCallback _window_create_callback) :
use_tor(use_tor),
+ use_system_mpv_config(use_system_mpv_config),
video_process_id(-1),
ipc_socket(-1),
connected_to_ipc(false),
@@ -74,18 +75,23 @@ namespace QuickMedia {
wid_arg += parent_window_str;
// TODO: Resume playback if the last video played matches the first video played next time QuickMedia is launched
- args.insert(args.end(), { "mpv", "--keep-open=yes", /*"--keep-open-pause=no",*/ input_ipc_server_arg.c_str(),
- "--no-config",
- //"--no-input-default-bindings", "--input-vo-keyboard=no",
- "--demuxer-max-bytes=40M", "--demuxer-max-back-bytes=20M",
- //"--no-input-terminal",
- //"--no-osc",
- "--profile=gpu-hq",
- "--vo=gpu",
- "--hwdec=auto",
+ args.insert(args.end(), {
+ "mpv", "--keep-open=yes", input_ipc_server_arg.c_str(),
"--no-resume-playback",
- /*"--vo=gpu", "--hwdec=auto",*/
- wid_arg.c_str(), "--", path, nullptr });
+ wid_arg.c_str()
+ });
+
+ if(!use_system_mpv_config) {
+ args.insert(args.end(), {
+ "--no-config", "--demuxer-max-bytes=40M", "--demuxer-max-back-bytes=20M",
+ "--profile=gpu-hq",
+ "--vo=gpu",
+ "--hwdec=auto"
+ });
+ }
+
+ args.insert(args.end(), { "--", path, nullptr });
+
if(exec_program_async(args.data(), &video_process_id) != 0)
return Error::FAIL_TO_LAUNCH_PROCESS;