Bug 1100803 - Re-create a decoded media stream if necessary. r=roc

This commit is contained in:
Alastor Wu 2014-12-15 09:22:15 +08:00
Родитель bf3526619d
Коммит 50d890e0f7
3 изменённых файлов: 12 добавлений и 3 удалений

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

@ -266,6 +266,14 @@ MediaDecoder::DecodedStreamGraphListener::NotifyEvent(MediaStreamGraph* aGraph,
aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
}
}
void MediaDecoder::RecreateDecodedStreamIfNecessary(int64_t aStartTimeUSecs)
{
if (mInitialAudioCaptured) {
RecreateDecodedStream(aStartTimeUSecs);
}
}
void MediaDecoder::DestroyDecodedStream()
{
MOZ_ASSERT(NS_IsMainThread());

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

@ -851,6 +851,9 @@ public:
// The decoder monitor must be held.
bool IsLogicallyPlaying();
// Re-create a decoded stream if audio being captured
void RecreateDecodedStreamIfNecessary(int64_t aStartTimeUSecs);
#ifdef MOZ_EME
// This takes the decoder monitor.
virtual nsresult SetCDMProxy(CDMProxy* aProxy) MOZ_OVERRIDE;

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

@ -1624,9 +1624,7 @@ MediaDecoderStateMachine::StartSeek(const SeekTarget& aTarget)
DECODER_LOG("Changed state to SEEKING (to %lld)", mSeekTarget.mTime);
SetState(DECODER_STATE_SEEKING);
if (mDecoder->GetDecodedStream()) {
mDecoder->RecreateDecodedStream(seekTime - mStartTime);
}
mDecoder->RecreateDecodedStreamIfNecessary(seekTime - mStartTime);
ScheduleStateMachine();
}