aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-18 17:46:28 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-18 17:46:28 +0100
commit08d6c26b6fc06bd7fc80bc168131998f95c12551 (patch)
tree0078d6baef27a388e711544ffc306ebcab9a3b60 /src
parent4140d7a30121aca34093afe5f52da9c08951f508 (diff)
Fix video thumbnail creation
Diffstat (limited to 'src')
-rw-r--r--src/FileAnalyzer.cpp6
-rw-r--r--src/VideoPlayer.cpp2
-rw-r--r--src/plugins/LocalAnime.cpp4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/FileAnalyzer.cpp b/src/FileAnalyzer.cpp
index 4e4470e..2ce8250 100644
--- a/src/FileAnalyzer.cpp
+++ b/src/FileAnalyzer.cpp
@@ -129,7 +129,7 @@ namespace QuickMedia {
bool video_get_first_frame(const FileAnalyzer &file, const char *destination_path, int width, int height) {
Path destination_path_tmp = destination_path;
- destination_path_tmp.append(".ftmp");
+ destination_path_tmp.append(".tmp.jpg");
const int middle_seconds = file.get_duration_seconds().value_or(0.0) / 2.0;
char middle_seconds_str[32];
@@ -139,13 +139,13 @@ namespace QuickMedia {
char framesize[128];
snprintf(framesize, sizeof(framesize), "%dx%d", width, height);
- const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-ss", middle_seconds_str, "-i", file.get_filepath().c_str(), "-vframes", "1", "-f", "singlejpeg", "-s", framesize, "--", destination_path_tmp.data.c_str(), nullptr };
+ const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-ss", middle_seconds_str, "-i", file.get_filepath().c_str(), "-vframes", "1", "-s", framesize, "--", destination_path_tmp.data.c_str(), nullptr };
if(exec_program(program_args, nullptr, nullptr) != 0) {
fprintf(stderr, "Failed to execute ffmpeg, maybe its not installed?\n");
return false;
}
} else {
- const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-ss", middle_seconds_str, "-i", file.get_filepath().c_str(), "-vframes", "1", "-f", "singlejpeg", "--", destination_path_tmp.data.c_str(), nullptr };
+ const char *program_args[] = { "ffmpeg", "-y", "-v", "quiet", "-ss", middle_seconds_str, "-i", file.get_filepath().c_str(), "-vframes", "1", "--", destination_path_tmp.data.c_str(), nullptr };
if(exec_program(program_args, nullptr, nullptr) != 0) {
fprintf(stderr, "Failed to execute ffmpeg, maybe its not installed?\n");
return false;
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 8fdf9dc..3e336fb 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -234,9 +234,11 @@ namespace QuickMedia {
if(startup_args.use_system_mpv_config) {
args.push_back("--config=yes");
+ args.push_back("--load-scripts=yes");
} else {
args.insert(args.end(), {
"--config=no",
+ "--load-scripts=no",
"--profile=gpu-hq",
"--vo=gpu,vdpau,x11",
"--hwdec=auto"
diff --git a/src/plugins/LocalAnime.cpp b/src/plugins/LocalAnime.cpp
index b78772d..318058b 100644
--- a/src/plugins/LocalAnime.cpp
+++ b/src/plugins/LocalAnime.cpp
@@ -30,13 +30,13 @@ namespace QuickMedia {
mgl::Rectangle watch_rect;
watch_rect.set_position({ widgets.thumbnail->position.x, widgets.thumbnail->position.y + widgets.thumbnail->size.y - rect_height });
watch_rect.set_size({ floor(widgets.thumbnail->size.x * watch_ratio), rect_height });
- watch_rect.set_color(mgl::Color(255, 0, 0, 255));
+ watch_rect.set_color(mgl::Color(150, 0, 0, 255));
render_target.draw(watch_rect);
mgl::Rectangle unwatch_rect;
unwatch_rect.set_position({ floor(widgets.thumbnail->position.x + widgets.thumbnail->size.x * watch_ratio), widgets.thumbnail->position.y + widgets.thumbnail->size.y - rect_height });
unwatch_rect.set_size({ floor(widgets.thumbnail->size.x * (1.0 - watch_ratio)), rect_height });
- unwatch_rect.set_color(mgl::Color(255, 255, 255, 255));
+ unwatch_rect.set_color(mgl::Color(150, 150, 150, 255));
render_target.draw(unwatch_rect);
}