Bug 1245463: [MSE] P3. Diags to ensure the Segment Parser Loop isn't running. r=gerald

This is similar to bug 1239983, we strongly assert should a segment parser loop be running when it must have completed.

MozReview-Commit-ID: CXqGoq9Opq0
This commit is contained in:
Jean-Yves Avenard 2016-02-10 17:50:28 +11:00
Родитель 018bf90ad7
Коммит 43fa8f611e
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -157,7 +157,7 @@ void
TrackBuffersManager::ResetParserState() TrackBuffersManager::ResetParserState()
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!mAppendRunning, "AbortAppendData must have been called"); MOZ_RELEASE_ASSERT(!mAppendRunning, "Append is running, abort must have been called");
MSE_DEBUG(""); MSE_DEBUG("");
// 1. If the append state equals PARSING_MEDIA_SEGMENT and the input buffer contains some complete coded frames, then run the coded frame processing algorithm until all of these complete coded frames have been processed. // 1. If the append state equals PARSING_MEDIA_SEGMENT and the input buffer contains some complete coded frames, then run the coded frame processing algorithm until all of these complete coded frames have been processed.
@ -334,7 +334,7 @@ void
TrackBuffersManager::CompleteResetParserState() TrackBuffersManager::CompleteResetParserState()
{ {
MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(!mAppendRunning); MOZ_RELEASE_ASSERT(!mAppendRunning);
MSE_DEBUG(""); MSE_DEBUG("");
for (auto& track : GetTracksList()) { for (auto& track : GetTracksList()) {
@ -574,7 +574,7 @@ TrackBuffersManager::InitSegmentParserLoop()
{ {
MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(mAppendPromise.IsEmpty() && !mAppendRunning); MOZ_RELEASE_ASSERT(mAppendPromise.IsEmpty() && !mAppendRunning);
RefPtr<AppendPromise> p = mAppendPromise.Ensure(__func__); RefPtr<AppendPromise> p = mAppendPromise.Ensure(__func__);
AppendIncomingBuffers(); AppendIncomingBuffers();
@ -608,6 +608,9 @@ void
TrackBuffersManager::SegmentParserLoop() TrackBuffersManager::SegmentParserLoop()
{ {
MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(OnTaskQueue());
mAppendRunning = true;
while (true) { while (true) {
// 1. If the input buffer is empty, then jump to the need more data step below. // 1. If the input buffer is empty, then jump to the need more data step below.
if (!mInputBuffer || mInputBuffer->IsEmpty()) { if (!mInputBuffer || mInputBuffer->IsEmpty()) {