From 401f02618046e86c84e73b844b51d46d56a9a180 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 15 Jul 2011 04:04:01 +0000 Subject: [PATCH] Fix crash when detaching video Originally committed to SVN as r5447. --- aegisub/src/video_display.cpp | 5 +++++ aegisub/src/video_slider.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index daf03d087..d6a13e5d8 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -162,6 +162,11 @@ VideoDisplay::VideoDisplay( } SetCursor(wxNullCursor); + + if (con->videoController->IsLoaded()) { + con->videoController->GetScriptSize(scriptW, scriptH); + OnVideoOpen(); + } } VideoDisplay::~VideoDisplay () { diff --git a/aegisub/src/video_slider.cpp b/aegisub/src/video_slider.cpp index e0ff0a449..3210de82c 100644 --- a/aegisub/src/video_slider.cpp +++ b/aegisub/src/video_slider.cpp @@ -62,6 +62,10 @@ VideoSlider::VideoSlider (wxWindow* parent, agi::Context *c) slots.push_back(vc->AddSeekListener(&VideoSlider::SetValue, this)); slots.push_back(vc->AddVideoOpenListener(&VideoSlider::VideoOpened, this)); slots.push_back(vc->AddKeyframesListener(&VideoSlider::KeyframesChanged, this)); + + if (vc->IsLoaded()) { + VideoOpened(); + } } void VideoSlider::SetValue(int value) {