aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp3
-rw-r--r--src/VideoPlayer.cpp13
2 files changed, 12 insertions, 4 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 96da31f..b9dd0f0 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -2529,6 +2529,8 @@ namespace QuickMedia {
} else if(!tabs[selected_tab].page->search_is_filter()) {
tab_associated_data[selected_tab].search_text_updated = true;
}
+ const BodyItem *selected_item = tabs[selected_tab].body->get_selected();
+ tab_associated_data[selected_tab].body_item_url_before_refresh = selected_item ? selected_item->url : "";
tabs[selected_tab].body->clear_items();
}
@@ -3265,6 +3267,7 @@ namespace QuickMedia {
startup_args.start_time = start_time;
startup_args.chapters = std::move(media_chapters);
startup_args.plugin_name = plugin_name;
+ startup_args.cache_on_disk = !video_page->is_local();
video_player = std::make_unique<VideoPlayer>(std::move(startup_args), video_event_callback, on_window_create);
VideoPlayer::Error err = video_player->load_video();
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 26e2013..3d3fcc7 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -182,21 +182,26 @@ namespace QuickMedia {
"--force-seekable=yes",
"--image-display-duration=5",
"--cache-pause=yes",
- "--cache=yes",
- "--cache-on-disk=yes",
- "--cache-secs=86400", // 24 hours
"--sub-font-size=50",
"--sub-margin-y=60",
"--sub-border-size=2.0",
"--sub-bold=yes",
"--input-default-bindings=yes",
"--input-vo-keyboard=yes",
- cache_dir.c_str(),
wid_arg.c_str(),
"--ipc-fd",
ipc_fd.c_str()
});
+ if(startup_args.cache_on_disk) {
+ args.insert(args.end(), {
+ "--cache=yes",
+ "--cache-on-disk=yes",
+ "--cache-secs=86400", // 24 hours
+ cache_dir.c_str()
+ });
+ }
+
if(startup_args.resume) {
args.push_back("--save-position-on-quit=yes");
args.push_back("--resume-playback=yes");