зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 15485839d79f (bug 1248909) for frequent wpt crashes during mediasource-append-buffer.html a=backout
--HG-- extra : commitid : 8D3aarBCm8E
This commit is contained in:
Родитель
07dc39e490
Коммит
d32f836f75
|
@ -104,6 +104,7 @@ TrackBuffersManager::TrackBuffersManager(dom::SourceBufferAttributes* aAttribute
|
|||
, mEvictionOccurred(false)
|
||||
, mMonitor("TrackBuffersManager")
|
||||
, mAppendRunning(false)
|
||||
, mSegmentParserLoopRunning(false)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread(), "Must be instanciated on the main thread");
|
||||
}
|
||||
|
@ -300,7 +301,7 @@ void
|
|||
TrackBuffersManager::CompleteResetParserState()
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mAppendRunning, "Append is running");
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mSegmentParserLoopRunning);
|
||||
MSE_DEBUG("");
|
||||
|
||||
for (auto& track : GetTracksList()) {
|
||||
|
@ -428,7 +429,6 @@ RefPtr<TrackBuffersManager::RangeRemovalPromise>
|
|||
TrackBuffersManager::CodedFrameRemovalWithPromise(TimeInterval aInterval)
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mAppendRunning, "Logic error: Append in progress");
|
||||
bool rv = CodedFrameRemoval(aInterval);
|
||||
return RangeRemovalPromise::CreateAndResolve(rv, __func__);
|
||||
}
|
||||
|
@ -437,6 +437,7 @@ bool
|
|||
TrackBuffersManager::CodedFrameRemoval(TimeInterval aInterval)
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MOZ_ASSERT(!mSegmentParserLoopRunning, "Logic error: Append in progress");
|
||||
MSE_DEBUG("From %.2fs to %.2f",
|
||||
aInterval.mStart.ToSeconds(), aInterval.mEnd.ToSeconds());
|
||||
|
||||
|
@ -575,6 +576,8 @@ TrackBuffersManager::SegmentParserLoop()
|
|||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
mSegmentParserLoopRunning = true;
|
||||
|
||||
while (true) {
|
||||
// 1. If the input buffer is empty, then jump to the need more data step below.
|
||||
if (!mInputBuffer || mInputBuffer->IsEmpty()) {
|
||||
|
@ -699,6 +702,7 @@ TrackBuffersManager::NeedMoreData()
|
|||
MSE_DEBUG("");
|
||||
RestoreCachedVariables();
|
||||
mAppendRunning = false;
|
||||
mSegmentParserLoopRunning = false;
|
||||
{
|
||||
// Wake-up any pending Abort()
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
|
@ -712,6 +716,7 @@ TrackBuffersManager::RejectAppend(nsresult aRejectValue, const char* aName)
|
|||
{
|
||||
MSE_DEBUG("rv=%d", aRejectValue);
|
||||
mAppendRunning = false;
|
||||
mSegmentParserLoopRunning = false;
|
||||
{
|
||||
// Wake-up any pending Abort()
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
|
|
|
@ -350,8 +350,11 @@ private:
|
|||
// Monitor to protect following objects accessed across multipple threads.
|
||||
// mMonitor is also notified if the value of mAppendRunning becomes false.
|
||||
mutable Monitor mMonitor;
|
||||
// Set to true while a BufferAppend is running or is pending.
|
||||
// Set to true while SegmentParserLoop is running.
|
||||
Atomic<bool> mAppendRunning;
|
||||
// Set to true while SegmentParserLoop is running.
|
||||
// This is for diagnostic only. Only accessed on the task queue.
|
||||
bool mSegmentParserLoopRunning;
|
||||
// Stable audio and video track time ranges.
|
||||
media::TimeIntervals mVideoBufferedRanges;
|
||||
media::TimeIntervals mAudioBufferedRanges;
|
||||
|
|
Загрузка…
Ссылка в новой задаче