From 7bd1da7d45ce72c35c2aff8dd15e3d42250fe76a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 16 Oct 2013 17:29:03 -0700 Subject: [PATCH] Fix saving screenshots of dummy video --- aegisub/src/command/video.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aegisub/src/command/video.cpp b/aegisub/src/command/video.cpp index 15ec44aee..2a944f319 100644 --- a/aegisub/src/command/video.cpp +++ b/aegisub/src/command/video.cpp @@ -461,14 +461,16 @@ struct video_frame_prev_large : public validator_video_loaded { }; static void save_snapshot(agi::Context *c, bool raw) { - static const agi::OptionValue* ssPath = OPT_GET("Path/Screenshot"); - std::string option = ssPath->GetString(); + auto option = OPT_GET("Path/Screenshot")->GetString(); agi::fs::path basepath; + auto videoname = c->videoController->GetVideoName(); + bool is_dummy = boost::starts_with(videoname.string(), "?dummy"); + // Is it a path specifier and not an actual fixed path? if (option[0] == '?') { // If dummy video is loaded, we can't save to the video location - if (boost::starts_with(option, "?video") && boost::starts_with(c->videoController->GetVideoName().string(), "?dummy")) { + if (boost::starts_with(option, "?video") && is_dummy) { // So try the script location instead option = "?script"; } @@ -483,7 +485,8 @@ static void save_snapshot(agi::Context *c, bool raw) { // Actual fixed (possibly relative) path, decode it else basepath = config::path->MakeAbsolute(option, "?user/"); - basepath /= c->videoController->GetVideoName().stem(); + + basepath /= is_dummy ? "dummy" : videoname.stem(); // Get full path int session_shot_count = 1;