Bug 1069289 - take |mAudioEndTime| into account when updating playback position at the end of playback. r=kinetik

This commit is contained in:
JW Wang 2014-10-07 19:45:00 +02:00
parent 049052f05d
commit 83dc138454

View File

@ -2478,8 +2478,8 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
// will take care of calling MediaDecoder::PlaybackEnded.
if (mDecoder->GetState() == MediaDecoder::PLAY_STATE_PLAYING &&
!mDecoder->GetDecodedStream()) {
int64_t videoTime = HasVideo() ? mVideoFrameEndTime : 0;
int64_t clockTime = std::max(mEndTime, videoTime);
int64_t clockTime = std::max(mAudioEndTime, mVideoFrameEndTime);
clockTime = std::max(int64_t(0), std::max(clockTime, mEndTime));
UpdatePlaybackPosition(clockTime);
{