From 8c44d698e4871333ff57fd5538531faf1f82e96c Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Tue, 28 Apr 2009 10:23:20 +0000 Subject: [PATCH] Don't try to synch audio when there is no audio player/provider present. (Could cause a crash under certain rare conditions.) Thanks Avi for report and fix. Originally committed to SVN as r2871. --- aegisub/src/video_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index 43eb0b93f..d48895564 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -750,7 +750,7 @@ void VideoContext::OnPlayTimer(wxTimerEvent &event) { if (nextFrame == frame_n) return; // Next frame is before or over 2 frames ahead, so force audio resync - if (keepAudioSync && (nextFrame < frame_n || nextFrame > frame_n + 2)) audio->player->SetCurrentPosition(audio->GetSampleAtMS(VFR_Output.GetTimeAtFrame(nextFrame))); + if (audio->player && keepAudioSync && (nextFrame < frame_n || nextFrame > frame_n + 2)) audio->player->SetCurrentPosition(audio->GetSampleAtMS(VFR_Output.GetTimeAtFrame(nextFrame))); // Jump to next frame playNextFrame = nextFrame;