mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-29 18:47:31 +09:00
Bug 1472925 - Keep a strong reference to MediaStreamGraph from GraphDriver.
This commit is contained in:
parent
d3a845d2fc
commit
44998d1f5b
3 changed files with 9 additions and 8 deletions
|
|
@ -200,7 +200,7 @@ public:
|
||||||
STREAM_LOG(LogLevel::Debug, ("Starting system thread"));
|
STREAM_LOG(LogLevel::Debug, ("Starting system thread"));
|
||||||
profiler_register_thread("MediaStreamGraph", &aLocal);
|
profiler_register_thread("MediaStreamGraph", &aLocal);
|
||||||
LIFECYCLE_LOG("Starting a new system driver for graph %p\n",
|
LIFECYCLE_LOG("Starting a new system driver for graph %p\n",
|
||||||
mDriver->mGraphImpl);
|
mDriver->mGraphImpl.get());
|
||||||
|
|
||||||
RefPtr<GraphDriver> previousDriver;
|
RefPtr<GraphDriver> previousDriver;
|
||||||
{
|
{
|
||||||
|
|
@ -236,7 +236,7 @@ private:
|
||||||
void
|
void
|
||||||
ThreadedDriver::Start()
|
ThreadedDriver::Start()
|
||||||
{
|
{
|
||||||
LIFECYCLE_LOG("Starting thread for a SystemClockDriver %p\n", mGraphImpl);
|
LIFECYCLE_LOG("Starting thread for a SystemClockDriver %p\n", mGraphImpl.get());
|
||||||
Unused << NS_WARN_IF(mThread);
|
Unused << NS_WARN_IF(mThread);
|
||||||
if (!mThread) { // Ensure we haven't already started it
|
if (!mThread) { // Ensure we haven't already started it
|
||||||
nsCOMPtr<nsIRunnable> event = new MediaStreamGraphInitThreadRunnable(this);
|
nsCOMPtr<nsIRunnable> event = new MediaStreamGraphInitThreadRunnable(this);
|
||||||
|
|
@ -830,7 +830,9 @@ AudioCallbackDriver::Revive()
|
||||||
mGraphImpl->SetCurrentDriver(NextDriver());
|
mGraphImpl->SetCurrentDriver(NextDriver());
|
||||||
NextDriver()->Start();
|
NextDriver()->Start();
|
||||||
} else {
|
} else {
|
||||||
STREAM_LOG(LogLevel::Debug, ("Starting audio threads for MediaStreamGraph %p from a new thread.", mGraphImpl));
|
STREAM_LOG(LogLevel::Debug,
|
||||||
|
("Starting audio threads for MediaStreamGraph %p from a new thread.",
|
||||||
|
mGraphImpl.get()));
|
||||||
RefPtr<AsyncCubebTask> initEvent =
|
RefPtr<AsyncCubebTask> initEvent =
|
||||||
new AsyncCubebTask(this, AsyncCubebOperation::INIT);
|
new AsyncCubebTask(this, AsyncCubebOperation::INIT);
|
||||||
initEvent->Dispatch();
|
initEvent->Dispatch();
|
||||||
|
|
|
||||||
|
|
@ -210,10 +210,8 @@ protected:
|
||||||
// Time of the end of this graph iteration. This must be accessed while having
|
// Time of the end of this graph iteration. This must be accessed while having
|
||||||
// the monitor.
|
// the monitor.
|
||||||
GraphTime mIterationEnd;
|
GraphTime mIterationEnd;
|
||||||
// The MediaStreamGraphImpl that owns this driver. This has a lifetime longer
|
// The MediaStreamGraphImpl associated with this driver.
|
||||||
// than the driver, and will never be null. Hence, it can be accesed without
|
const RefPtr<MediaStreamGraphImpl> mGraphImpl;
|
||||||
// monitor.
|
|
||||||
MediaStreamGraphImpl* mGraphImpl;
|
|
||||||
|
|
||||||
// This enum specifies the wait state of the driver.
|
// This enum specifies the wait state of the driver.
|
||||||
enum WaitState {
|
enum WaitState {
|
||||||
|
|
|
||||||
|
|
@ -3371,7 +3371,8 @@ MediaStreamGraphImpl::Destroy()
|
||||||
// First unregister from memory reporting.
|
// First unregister from memory reporting.
|
||||||
UnregisterWeakMemoryReporter(this);
|
UnregisterWeakMemoryReporter(this);
|
||||||
|
|
||||||
// Clear the self reference which will destroy this instance.
|
// Clear the self reference which will destroy this instance if all
|
||||||
|
// associated GraphDrivers are destroyed.
|
||||||
mSelfRef = nullptr;
|
mSelfRef = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue