зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1402681 - part1 : do not queue the task without task queue. r=jya
Since the source buffer is a wrapped native, it would be unlinked twice and then the TrackBuffersManager::Detach() would also be called twice. The first detach task would clear the task queue of TrackBuffersManager, and then we won't accept any new task without task queue. The second detach task should not be executed. MozReview-Commit-ID: AWTzVbRH5B1 --HG-- extra : rebase_source : 557e22f56f8541b06174e41604ca57cb01325d61
This commit is contained in:
Родитель
a1a7652547
Коммит
eaf6e2d76e
|
@ -145,6 +145,15 @@ TrackBuffersManager::DoAppendData(already_AddRefed<MediaByteBuffer> aData,
|
|||
void
|
||||
TrackBuffersManager::QueueTask(SourceBufferTask* aTask)
|
||||
{
|
||||
// The source buffer is a wrapped native, it would be unlinked twice and so
|
||||
// the TrackBuffersManager::Detach() would also be called twice. Since the
|
||||
// detach task has been done before, we could ignore this task.
|
||||
if (!GetTaskQueue()) {
|
||||
MOZ_ASSERT(aTask->GetType() == SourceBufferTask::Type::Detach,
|
||||
"only detach task could happen here!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!OnTaskQueue()) {
|
||||
GetTaskQueue()->Dispatch(NewRunnableMethod<RefPtr<SourceBufferTask>>(
|
||||
"TrackBuffersManager::QueueTask",
|
||||
|
|
Загрузка…
Ссылка в новой задаче