Closed Bug 914392 Opened 11 years ago Closed 9 years ago

Remove AudioNodeEngine::NodeMutex() usage

Categories

(Core :: Web Audio, defect, P3)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(3 files)

Most clients of the NodeMutex() and AudioNode* Node() methods on AudioNodeEngine are calling from the main thread and so should be using NodeMainThread().

ProduceAudioBlock() in AnalyserNodeEngine and ScriptProcessorNodeEngine use NodeMutex() and Node() to check whether the node is alive before dispatching the event.  This check is not necessary, because the event needs to handle the case of the Node getting destroyed before the event runs anyway.
Priority: -- → P3
Assignee: nobody → karlt
Status: NEW → ASSIGNED
so that it is always available.
Attachment #8633758 - Flags: review?(padenot)
If DestroyMediaStream() has cleared the node on the engine, then it will call
MediaStream::Destroy().  I doubt the additional code and cost of repeatedly
checking this is worth the savings in no-op events dispatched to main thread
between MediaStream::Destroy() on the main thread and destruction on the graph
thread.

Also ScriptProcessorNode should not be potentially ignoring its output buffer
immediately when the ScriptProcessor loses its last reference.  At least the
block currently being processed should output the output buffer.
(Deterministically playing the remainder of the output buffer would be best.)
Attachment #8633759 - Flags: review?(padenot)
Attachment #8633757 - Flags: review?(padenot) → review+
Attachment #8633758 - Flags: review?(padenot) → review+
Attachment #8633759 - Flags: review?(padenot) → review+
Depends on: 1189168
You need to log in before you can comment on or make changes to this bug.