diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-03-04 01:43:44 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-03-04 01:43:44 +0100 |
commit | d037e38d8e65e8dc20e783e03fdb7474ed93cf4c (patch) | |
tree | bd3cccacd29c6a102ad99d9760720a0c2752673d /src/AsyncImageLoader.cpp | |
parent | a13c19e31cb033730fa179a90f0bc5bd961bd3dc (diff) |
Do not call ffprobe for thumbnails unless its guaranteed to be a local video file
Diffstat (limited to 'src/AsyncImageLoader.cpp')
-rw-r--r-- | src/AsyncImageLoader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/AsyncImageLoader.cpp b/src/AsyncImageLoader.cpp index b0efb05..2919f41 100644 --- a/src/AsyncImageLoader.cpp +++ b/src/AsyncImageLoader.cpp @@ -160,7 +160,7 @@ namespace QuickMedia { void AsyncImageLoader::load_create_thumbnail(const Path &thumbnail_path, const Path &thumbnail_path_resized, ThumbnailData *thumbnail_data, mgl::vec2i resize_target_size) { FileAnalyzer file_analyzer; - if(!file_analyzer.load_file(thumbnail_path.data.c_str(), true)) { + if(!file_analyzer.load_file(thumbnail_path.data.c_str(), false)) { fprintf(stderr, "Failed to convert %s to a thumbnail\n", thumbnail_path.data.c_str()); thumbnail_data->image = std::make_unique<mgl::Image>(); thumbnail_data->loading_state = LoadingState::FINISHED_LOADING; @@ -168,7 +168,7 @@ namespace QuickMedia { } if(is_content_type_video(file_analyzer.get_content_type())) { - if(video_get_first_frame(file_analyzer, thumbnail_path_resized.data.c_str(), resize_target_size.x, resize_target_size.y)) { + if(file_analyzer.load_metadata() && video_get_first_frame(file_analyzer, thumbnail_path_resized.data.c_str(), resize_target_size.x, resize_target_size.y)) { thumbnail_data->loading_state = LoadingState::READY_TO_LOAD; } else { fprintf(stderr, "Failed to get video frame of %s\n", thumbnail_path.data.c_str()); |