mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
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:
parent
bfb725b5f3
commit
ce6cdc5ce3
@ -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__);
|
||||
}
|
||||
});
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user