Bug 1182985: Drain decoder when changing resolution. r=cpearce

This commit is contained in:
Jean-Yves Avenard 2015-07-13 16:25:04 +10:00
Родитель 8ca249040e
Коммит d709da531a
2 изменённых файлов: 13 добавлений и 0 удалений

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

@ -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;
};