зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1182985: Drain decoder when changing resolution. r=cpearce
This commit is contained in:
Родитель
8ca249040e
Коммит
d709da531a
|
@ -875,6 +875,17 @@ MediaFormatReader::DecodeDemuxedSamples(TrackType aTrack,
|
|||
return;
|
||||
}
|
||||
|
||||
if (decoder.mNextStreamSourceID.isNothing() ||
|
||||
decoder.mNextStreamSourceID.ref() != info->GetID()) {
|
||||
LOG("%s stream id has changed from:%d to:%d, draining decoder.",
|
||||
TrackTypeToStr(aTrack), decoder.mLastStreamSourceID,
|
||||
info->GetID());
|
||||
decoder.mNeedDraining = true;
|
||||
decoder.mNextStreamSourceID = Some(info->GetID());
|
||||
DrainDecoder(aTrack);
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("%s stream id has changed from:%d to:%d, recreating decoder.",
|
||||
TrackTypeToStr(aTrack), decoder.mLastStreamSourceID,
|
||||
info->GetID());
|
||||
|
|
|
@ -285,12 +285,14 @@ private:
|
|||
mNumSamplesInput = 0;
|
||||
mNumSamplesOutput = 0;
|
||||
mSizeOfQueue = 0;
|
||||
mNextStreamSourceID.reset();
|
||||
}
|
||||
|
||||
// Used by the MDSM for logging purposes.
|
||||
Atomic<size_t> mSizeOfQueue;
|
||||
// Sample format monitoring.
|
||||
uint32_t mLastStreamSourceID;
|
||||
Maybe<uint32_t> mNextStreamSourceID;
|
||||
media::TimeIntervals mTimeRanges;
|
||||
nsRefPtr<SharedTrackInfo> mInfo;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче