Bug 1988931 use GetInstanceIfExists() from MediaTrackGraphImpl::GetInstance() a=dmeehan DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D265213 Differential Revision: https://phabricator.services.mozilla.com/D265876
This commit is contained in:
committed by
dmeehan@mozilla.com
parent
4728bcf71e
commit
11829818fa
@@ -3571,11 +3571,10 @@ MediaTrackGraphImpl* MediaTrackGraphImpl::GetInstance(
|
|||||||
MOZ_ASSERT(aGraphDriverRequested != OFFLINE_THREAD_DRIVER,
|
MOZ_ASSERT(aGraphDriverRequested != OFFLINE_THREAD_DRIVER,
|
||||||
"Use CreateNonRealtimeInstance() for offline graphs");
|
"Use CreateNonRealtimeInstance() for offline graphs");
|
||||||
|
|
||||||
GraphHashSet* graphs = Graphs();
|
MediaTrackGraphImpl* graph =
|
||||||
GraphHashSet::AddPtr addPtr =
|
GetInstanceIfExists(aWindowID, aSampleRate, aPrimaryOutputDeviceID);
|
||||||
graphs->lookupForAdd({aWindowID, aSampleRate, aPrimaryOutputDeviceID});
|
if (graph) { // graph already exists
|
||||||
if (addPtr) { // graph already exists
|
return graph;
|
||||||
return *addPtr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphRunType runType = DIRECT_DRIVER;
|
GraphRunType runType = DIRECT_DRIVER;
|
||||||
@@ -3586,10 +3585,11 @@ MediaTrackGraphImpl* MediaTrackGraphImpl::GetInstance(
|
|||||||
// In a real time graph, the number of output channels is determined by
|
// In a real time graph, the number of output channels is determined by
|
||||||
// the underlying number of channel of the default audio output device.
|
// the underlying number of channel of the default audio output device.
|
||||||
uint32_t channelCount = CubebUtils::MaxNumberOfChannels();
|
uint32_t channelCount = CubebUtils::MaxNumberOfChannels();
|
||||||
MediaTrackGraphImpl* graph = new MediaTrackGraphImpl(
|
graph = new MediaTrackGraphImpl(aWindowID, aSampleRate,
|
||||||
aWindowID, aSampleRate, aPrimaryOutputDeviceID, aMainThread);
|
aPrimaryOutputDeviceID, aMainThread);
|
||||||
graph->Init(aGraphDriverRequested, runType, channelCount);
|
graph->Init(aGraphDriverRequested, runType, channelCount);
|
||||||
MOZ_ALWAYS_TRUE(graphs->add(addPtr, graph));
|
MOZ_ALWAYS_TRUE(Graphs()->putNew(
|
||||||
|
{aWindowID, aSampleRate, aPrimaryOutputDeviceID}, graph));
|
||||||
|
|
||||||
LOG(LogLevel::Debug, ("Starting up MediaTrackGraph %p for window 0x%" PRIx64,
|
LOG(LogLevel::Debug, ("Starting up MediaTrackGraph %p for window 0x%" PRIx64,
|
||||||
graph, aWindowID));
|
graph, aWindowID));
|
||||||
|
|||||||
Reference in New Issue
Block a user