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

View File

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