diff --git a/src/command/subtitle.cpp b/src/command/subtitle.cpp index 02bc640cf..1edacb000 100644 --- a/src/command/subtitle.cpp +++ b/src/command/subtitle.cpp @@ -286,7 +286,7 @@ struct subtitle_open_video final : public Command { void operator()(agi::Context *c) override { if (c->subsController->TryToClose() == wxCANCEL) return; - c->subsController->Load(c->project->VideoName(), "binary"); + c->project->LoadSubtitles(c->project->VideoName(), "binary", false); } bool Validate(const agi::Context *c) override { diff --git a/src/project.cpp b/src/project.cpp index 21bfe23ce..2d1a404a7 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -158,9 +158,9 @@ bool Project::DoLoadSubtitles(agi::fs::path const& path, std::string encoding, P return true; } -void Project::LoadSubtitles(agi::fs::path path, std::string encoding) { +void Project::LoadSubtitles(agi::fs::path path, std::string encoding, bool load_linked) { ProjectProperties properties; - if (DoLoadSubtitles(path, encoding, properties)) + if (DoLoadSubtitles(path, encoding, properties) && load_linked) LoadUnloadFiles(properties); } diff --git a/src/project.h b/src/project.h index 1fd034d08..385a41b4b 100644 --- a/src/project.h +++ b/src/project.h @@ -69,7 +69,7 @@ public: Project(agi::Context *context); ~Project(); - void LoadSubtitles(agi::fs::path path, std::string encoding=""); + void LoadSubtitles(agi::fs::path path, std::string encoding="", bool load_linked=true); void CloseSubtitles(); bool CanLoadSubtitlesFromVideo() const { return video_has_subtitles; }