Backed out changeset 12a04a66d5c1 (bug 1051658)

This commit is contained in:
Ed Morley 2014-09-30 16:48:06 +01:00
Родитель 673f3a21d4
Коммит 3bbb8fd4bd
2 изменённых файлов: 11 добавлений и 30 удалений

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

@ -1154,9 +1154,9 @@ void MediaDecoderStateMachine::StartPlayback()
SetPlayStartTime(TimeStamp::Now());
NS_ASSERTION(IsPlaying(), "Should report playing by end of StartPlayback()");
nsresult rv = StartAudioThread();
NS_ENSURE_SUCCESS_VOID(rv);
if (NS_FAILED(StartAudioThread())) {
DECODER_WARN("Failed to create audio thread");
}
mDecoder->GetReentrantMonitor().NotifyAll();
mDecoder->UpdateStreamBlockingForStateMachinePlaying();
DispatchDecodeTasksIfNeeded();
@ -1791,12 +1791,15 @@ MediaDecoderStateMachine::StartAudioThread()
mStopAudioThread = false;
if (HasAudio() && !mAudioSink) {
mAudioCompleted = false;
mAudioSink = new AudioSink(this, mAudioStartTime,
mInfo.mAudio, mDecoder->GetAudioChannel());
// OnAudioSinkError() will be called before Init() returns if an error
// occurs during initialization.
mAudioSink = new AudioSink(this,
mAudioStartTime, mInfo.mAudio, mDecoder->GetAudioChannel());
nsresult rv = mAudioSink->Init();
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
DECODER_WARN("Changed state to SHUTDOWN because audio sink initialization failed");
SetState(DECODER_STATE_SHUTDOWN);
mScheduler->ScheduleAndShutdown();
return rv;
}
mAudioSink->SetVolume(mVolume);
mAudioSink->SetPlaybackRate(mPlaybackRate);
@ -3121,25 +3124,6 @@ void MediaDecoderStateMachine::OnAudioSinkComplete()
mDecoder->GetReentrantMonitor().NotifyAll();
}
void MediaDecoderStateMachine::OnAudioSinkError()
{
AssertCurrentThreadInMonitor();
// AudioSink not used with captured streams, so ignore errors in this case.
if (mAudioCaptured) {
return;
}
mAudioCompleted = true;
// Notify media decoder/element about this error.
RefPtr<nsIRunnable> task(
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::OnDecodeError));
nsresult rv = mDecodeTaskQueue->Dispatch(task);
if (NS_FAILED(rv)) {
DECODER_WARN("Failed to dispatch OnDecodeError");
}
}
} // namespace mozilla
// avoid redefined macro in unified build

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

@ -636,9 +636,6 @@ protected:
// and the sink is shutting down.
void OnAudioSinkComplete();
// Called by the AudioSink to signal errors.
void OnAudioSinkError();
// The decoder object that created this state machine. The state machine
// holds a strong reference to the decoder to ensure that the decoder stays
// alive once media element has started the decoder shutdown process, and has