mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 589626 - Backed out changeset 757b7a43aad0 a=backout
This commit is contained in:
parent
8441595dcc
commit
a146561fe9
@ -164,7 +164,7 @@ PRBool nsBuiltinDecoderStateMachine::HasFutureAudio() const {
|
||||
mDecoder->GetMonitor().AssertCurrentThreadIn();
|
||||
PRBool aboveLowAudioThreshold = PR_FALSE;
|
||||
if (mAudioEndTime != -1) {
|
||||
aboveLowAudioThreshold = mAudioEndTime - GetMediaTime() > LOW_AUDIO_MS;
|
||||
aboveLowAudioThreshold = mAudioEndTime - mCurrentFrameTime + mStartTime > LOW_AUDIO_MS;
|
||||
}
|
||||
return HasAudio() &&
|
||||
!mAudioCompleted &&
|
||||
@ -259,7 +259,7 @@ void nsBuiltinDecoderStateMachine::DecodeLoop()
|
||||
PRInt64 audioDecoded = 0;
|
||||
{
|
||||
MonitorAutoEnter mon(mDecoder->GetMonitor());
|
||||
currentTime = GetMediaTime();
|
||||
currentTime = mCurrentFrameTime + mStartTime;
|
||||
audioDecoded = mReader->mAudioQueue.Duration();
|
||||
if (mAudioEndTime != -1) {
|
||||
audioDecoded += mAudioEndTime - currentTime;
|
||||
@ -466,7 +466,7 @@ void nsBuiltinDecoderStateMachine::AudioLoop()
|
||||
break;
|
||||
}
|
||||
|
||||
PRInt64 audioAhead = mAudioEndTime - GetMediaTime();
|
||||
PRInt64 audioAhead = mAudioEndTime - mCurrentFrameTime - mStartTime;
|
||||
if (audioAhead > AMPLE_AUDIO_MS) {
|
||||
// We've pushed enough audio onto the hardware that we've queued up a
|
||||
// significant amount ahead of the playback position. The decode
|
||||
@ -668,7 +668,7 @@ void nsBuiltinDecoderStateMachine::UpdatePlaybackPosition(PRInt64 aTime)
|
||||
}
|
||||
|
||||
// Notify DOM of any queued up audioavailable events
|
||||
mEventManager.DispatchPendingEvents(GetMediaTime());
|
||||
mEventManager.DispatchPendingEvents(mCurrentFrameTime + mStartTime);
|
||||
}
|
||||
|
||||
void nsBuiltinDecoderStateMachine::ClearPositionChangeFlag()
|
||||
@ -996,7 +996,6 @@ nsresult nsBuiltinDecoderStateMachine::Run()
|
||||
StopPlayback(AUDIO_SHUTDOWN);
|
||||
StopDecodeThreads();
|
||||
ResetPlayback();
|
||||
PRInt64 currentTime = GetMediaTime();
|
||||
nsresult res;
|
||||
{
|
||||
MonitorAutoExit exitMon(mDecoder->GetMonitor());
|
||||
@ -1005,7 +1004,7 @@ nsresult nsBuiltinDecoderStateMachine::Run()
|
||||
res = mReader->Seek(seekTime,
|
||||
mStartTime,
|
||||
mEndTime,
|
||||
currentTime);
|
||||
mCurrentFrameTime + mStartTime);
|
||||
}
|
||||
if (NS_SUCCEEDED(res)){
|
||||
PRInt64 audioTime = seekTime;
|
||||
@ -1043,7 +1042,7 @@ nsresult nsBuiltinDecoderStateMachine::Run()
|
||||
// if we need to seek again.
|
||||
|
||||
nsCOMPtr<nsIRunnable> stopEvent;
|
||||
if (GetMediaTime() == mEndTime) {
|
||||
if (mCurrentFrameTime == mEndTime) {
|
||||
LOG(PR_LOG_DEBUG, ("%p Changed state from SEEKING (to %lldms) to COMPLETED",
|
||||
mDecoder, seekTime));
|
||||
stopEvent = NS_NewRunnableMethod(mDecoder, &nsBuiltinDecoder::SeekingStoppedAtEnd);
|
||||
|
@ -338,16 +338,6 @@ protected:
|
||||
// be held.
|
||||
PRBool IsPlaying();
|
||||
|
||||
// Returns the "media time". This is the absolute time which the media
|
||||
// playback has reached. i.e. this returns values in the range
|
||||
// [mStartTime, mEndTime], and mStartTime will not be 0 if the media does
|
||||
// not start at 0. Note this is different to the value returned
|
||||
// by GetCurrentTime(), which is in the range [0,duration].
|
||||
PRInt64 GetMediaTime() const {
|
||||
mDecoder->GetMonitor().AssertCurrentThreadIn();
|
||||
return mStartTime + mCurrentFrameTime;
|
||||
}
|
||||
|
||||
// Monitor on mAudioStream. This monitor must be held in order to delete
|
||||
// or use the audio stream. This stops us destroying the audio stream
|
||||
// while it's being used on another thread (typically when it's being
|
||||
|
Loading…
Reference in New Issue
Block a user