Bug 1205470: [MSE] Remove assertion. r=cpearce

Can also remove mInitDone member as that information is redundant with the init promise being present
This commit is contained in:
Jean-Yves Avenard 2015-09-21 12:28:56 +10:00
parent eb5a4e3717
commit 3a47518da0
2 changed files with 1 additions and 6 deletions

View File

@ -27,7 +27,6 @@ using media::TimeIntervals;
MediaSourceDemuxer::MediaSourceDemuxer()
: mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK),
/* aSupportsTailDispatch = */ true))
, mInitDone(false)
, mMonitor("MediaSourceDemuxer")
{
MOZ_ASSERT(NS_IsMainThread());
@ -46,7 +45,6 @@ MediaSourceDemuxer::AttemptInit()
MOZ_ASSERT(OnTaskQueue());
if (ScanSourceBuffersForContent()) {
mInitDone = true;
return InitPromise::CreateAndResolve(NS_OK, __func__);
}
@ -60,12 +58,10 @@ void MediaSourceDemuxer::NotifyDataArrived(uint32_t aLength, int64_t aOffset)
nsRefPtr<MediaSourceDemuxer> self = this;
nsCOMPtr<nsIRunnable> task =
NS_NewRunnableFunction([self] () {
if (self->mInitDone) {
if (self->mInitPromise.IsEmpty()) {
return;
}
MOZ_ASSERT(!self->mInitPromise.IsEmpty());
if (self->ScanSourceBuffersForContent()) {
self->mInitDone = true;
self->mInitPromise.ResolveIfExists(NS_OK, __func__);
}
});

View File

@ -74,7 +74,6 @@ private:
nsTArray<nsRefPtr<TrackBuffersManager>> mSourceBuffers;
MozPromiseHolder<InitPromise> mInitPromise;
bool mInitDone;
// Monitor to protect members below across multiple threads.
mutable Monitor mMonitor;