Bug 1096597 - Switch to buffering mode on WAITING_FOR_DATA. r=cpearce

This commit is contained in:
Bobby Holley 2014-11-11 20:50:22 -08:00
Родитель e2dd17c59b
Коммит 19f7e785c2
2 изменённых файлов: 8 добавлений и 3 удалений

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

@ -910,7 +910,6 @@ NS_IMETHODIMP MediaDecoder::Observe(nsISupports *aSubjet,
MediaDecoder::Statistics
MediaDecoder::GetStatistics()
{
MOZ_ASSERT(NS_IsMainThread() || OnStateMachineThread());
Statistics result;
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());

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

@ -821,9 +821,15 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
return;
}
// If the decoder is waiting for data, there's nothing more to do after
// clearing the pending request.
// If the decoder is waiting for data, we need to make sure that the requests
// are cleared, which happened above. Additionally, if we're out of decoded
// samples, we need to switch to buffering mode.
if (aReason == RequestSampleCallback::WAITING_FOR_DATA) {
bool outOfSamples = isAudio ? !AudioQueue().GetSize() : !VideoQueue().GetSize();
if (outOfSamples) {
StartBuffering();
}
return;
}