Issue #446 - Fixed some crashing while trying to play video without audio loaded, on posix

Originally committed to SVN as r1463.
This commit is contained in:
Rodrigo Braz Monteiro 2007-07-30 04:05:45 +00:00
parent 1e1f7b411b
commit 1d6f2f90c6

View file

@ -741,7 +741,7 @@ void VideoContext::OnPlayTimer(wxTimerEvent &event) {
JumpToFrame(nextFrame);
// Sync audio
if (keepAudioSync && nextFrame % 10 == 0) {
if (keepAudioSync && nextFrame % 10 == 0 && audio && audio->provider && audio->player) {
__int64 audPos = audio->GetSampleAtMS(VFR_Output.GetTimeAtFrame(nextFrame));
__int64 curPos = audio->player->GetCurrentPosition();
int delta = int(audPos-curPos);