mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-09 09:58:57 +00:00
Don't wait for a drain complete that will never happen
This prevents a deadlock that is due to the HTMLMediaElement calling MediaDecoder::NotifyOwnerActivityChanged() , attempt to grab the monitor, which is held by the SharedDecoderManager which is waiting for SetIdle() to complete.
This commit is contained in:
@@ -98,9 +98,12 @@ SharedDecoderManager::CreateVideoDecoder(
|
||||
mPDM = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
mPDM = aPDM;
|
||||
nsresult rv = mDecoder->Init();
|
||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
||||
if (NS_FAILED(rv)) {
|
||||
mDecoder = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
mPDM = aPDM;
|
||||
}
|
||||
|
||||
nsRefPtr<SharedDecoderProxy> proxy(new SharedDecoderProxy(this, aCallback));
|
||||
@@ -148,10 +151,11 @@ SharedDecoderManager::SetIdle(MediaDataDecoder* aProxy)
|
||||
{
|
||||
if (aProxy && mActiveProxy == aProxy) {
|
||||
mWaitForInternalDrain = true;
|
||||
mActiveProxy->Drain();
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
while (mWaitForInternalDrain) {
|
||||
mon.Wait();
|
||||
if (NS_SUCCEEDED(mActiveProxy->Drain())) {
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
while (mWaitForInternalDrain) {
|
||||
mon.Wait();
|
||||
}
|
||||
}
|
||||
mActiveProxy->Flush();
|
||||
mActiveProxy = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user