mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 1185886: P2. Don't unnecessarily drain decoders when there's no frames pending. r=cpearce
This commit is contained in:
parent
906996fe29
commit
0259a11e37
@ -715,6 +715,7 @@ MediaFormatReader::NotifyDrainComplete(TrackType aTrack)
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
auto& decoder = GetDecoderData(aTrack);
|
||||
LOG("%s", TrackTypeToStr(aTrack));
|
||||
if (!decoder.mOutputRequested) {
|
||||
LOG("MediaFormatReader called DrainComplete() before flushing, ignoring.");
|
||||
return;
|
||||
@ -983,6 +984,11 @@ MediaFormatReader::DrainDecoder(TrackType aTrack)
|
||||
return;
|
||||
}
|
||||
decoder.mOutputRequested = true;
|
||||
if (decoder.mNumSamplesInput == decoder.mNumSamplesOutput) {
|
||||
// No frames to drain.
|
||||
NotifyDrainComplete(aTrack);
|
||||
return;
|
||||
}
|
||||
decoder.mDecoder->Drain();
|
||||
decoder.mDraining = true;
|
||||
LOG("Requesting %s decoder to drain", TrackTypeToStr(aTrack));
|
||||
|
Loading…
Reference in New Issue
Block a user