Don't modify the "YCbCr Matrix" header when dummy video is opened

Color matching to dummy video makes zero sense, and setting it to None
results in breakage when someone opens dummy video for an already
typeset script.

Closes #1690.
This commit is contained in:
Thomas Goyne 2014-01-11 15:45:05 -08:00
parent cf79e521e4
commit 1c07f92d02
2 changed files with 4 additions and 2 deletions

View file

@ -253,7 +253,9 @@ void VideoContext::OnSubtitlesSave() {
ar = std::to_string((int)ar_type);
context->ass->SetScriptInfo("Video File", config::path->MakeRelative(video_filename, "?script").generic_string());
context->ass->SetScriptInfo("YCbCr Matrix", video_provider->GetColorSpace());
auto matrix = video_provider->GetColorSpace();
if (!matrix.empty())
context->ass->SetScriptInfo("YCbCr Matrix", matrix);
context->ass->SaveUIState("Video Aspect Ratio", ar);
context->ass->SaveUIState("Video Position", std::to_string(frame_n));
}

View file

@ -86,6 +86,6 @@ public:
double GetDAR() const override { return 0; }
agi::vfr::Framerate GetFPS() const override { return fps; }
std::vector<int> GetKeyFrames() const override { return {}; }
std::string GetColorSpace() const override { return "None"; }
std::string GetColorSpace() const override { return ""; }
std::string GetDecoderName() const override { return "Dummy Video Provider"; }
};