This commit is contained in:
Matthew Gregan 2010-02-26 15:11:52 -08:00
Родитель 1ff5236aae 841c9fbf9c
Коммит 28a23cc179
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -1084,6 +1084,9 @@ void nsOggDecodeStateMachine::StartPlayback()
// Null out mPauseStartTime
mPauseStartTime = TimeStamp();
}
mPlayStartTime = TimeStamp::Now();
mPauseDuration = 0;
}
void nsOggDecodeStateMachine::StopPlayback()
@ -1104,6 +1107,9 @@ void nsOggDecodeStateMachine::PausePlayback()
mAudioStream->Pause();
mPlaying = PR_FALSE;
mPauseStartTime = TimeStamp::Now();
if (mAudioStream->GetPosition() < 0) {
mLastFrame = mDecodedFrames.ResetTimes(mCallbackPeriod);
}
}
void nsOggDecodeStateMachine::ResumePlayback()
@ -1122,6 +1128,8 @@ void nsOggDecodeStateMachine::ResumePlayback()
// Null out mPauseStartTime
mPauseStartTime = TimeStamp();
}
mPlayStartTime = TimeStamp::Now();
mPauseDuration = 0;
}
void nsOggDecodeStateMachine::UpdatePlaybackPosition(float aTime)
@ -1501,9 +1509,6 @@ nsresult nsOggDecodeStateMachine::Run()
QueueDecodedFrames();
while (mDecodedFrames.IsEmpty() && !mDecodingCompleted &&
!mBufferExhausted) {
if (mPlaying) {
PausePlayback();
}
mon.Wait(PR_MillisecondsToInterval(PRInt64(mCallbackPeriod*500)));
if (mState != DECODER_STATE_DECODING)
break;