forked from mia/Aegisub
Fix restoring video position from saved project info
This commit is contained in:
parent
d004fc1856
commit
99b46f6a14
2 changed files with 11 additions and 16 deletions
|
@ -300,6 +300,13 @@ void Project::LoadVideo(agi::fs::path const& path) {
|
||||||
if (!DoLoadVideo(path)) return;
|
if (!DoLoadVideo(path)) return;
|
||||||
if (OPT_GET("Video/Open Audio")->GetBool() && audio_file != video_file && video_provider->HasAudio())
|
if (OPT_GET("Video/Open Audio")->GetBool() && audio_file != video_file && video_provider->HasAudio())
|
||||||
DoLoadAudio(video_file, true);
|
DoLoadAudio(video_file, true);
|
||||||
|
|
||||||
|
double dar = video_provider->GetDAR();
|
||||||
|
if (dar > 0)
|
||||||
|
context->videoController->SetAspectRatio(dar);
|
||||||
|
else
|
||||||
|
context->videoController->SetAspectRatio(AspectRatio::Default);
|
||||||
|
context->videoController->JumpToFrame(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::CloseVideo() {
|
void Project::CloseVideo() {
|
||||||
|
@ -307,6 +314,9 @@ void Project::CloseVideo() {
|
||||||
video_provider.reset();
|
video_provider.reset();
|
||||||
SetPath(video_file, "?video", "", "");
|
SetPath(video_file, "?video", "", "");
|
||||||
video_has_subtitles = false;
|
video_has_subtitles = false;
|
||||||
|
context->ass->Properties.ar_mode = 0;
|
||||||
|
context->ass->Properties.ar_value = 0.0;
|
||||||
|
context->ass->Properties.video_position = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::DoLoadTimecodes(agi::fs::path const& path) {
|
void Project::DoLoadTimecodes(agi::fs::path const& path) {
|
||||||
|
|
|
@ -60,23 +60,8 @@ VideoController::VideoController(agi::Context *c)
|
||||||
|
|
||||||
void VideoController::OnNewVideoProvider(AsyncVideoProvider *new_provider) {
|
void VideoController::OnNewVideoProvider(AsyncVideoProvider *new_provider) {
|
||||||
Stop();
|
Stop();
|
||||||
frame_n = 0;
|
|
||||||
|
|
||||||
provider = new_provider;
|
provider = new_provider;
|
||||||
if (!provider) {
|
color_matrix = provider ? provider->GetColorSpace() : "";
|
||||||
color_matrix.clear();
|
|
||||||
context->ass->Properties.ar_mode = 0;
|
|
||||||
context->ass->Properties.ar_value = 0.0;
|
|
||||||
context->ass->Properties.video_position = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
color_matrix = provider->GetColorSpace();
|
|
||||||
double dar = provider->GetDAR();
|
|
||||||
if (dar > 0)
|
|
||||||
SetAspectRatio(dar);
|
|
||||||
|
|
||||||
JumpToFrame(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoController::OnSubtitlesCommit(int type, std::set<const AssDialogue *> const& changed) {
|
void VideoController::OnSubtitlesCommit(int type, std::set<const AssDialogue *> const& changed) {
|
||||||
|
|
Loading…
Reference in a new issue