Skip to content

refactor: cleanup the media element audio source node - #1443

Merged
mdydek merged 4 commits into
mainfrom
refactor/simpler-media-element-audio-source-node
Nov 17, 2026
Merged

mdydek merged 4 commits into
mainfrom
refactor/simpler-media-element-audio-source-node

Conversation

@mdydek

@mdydek mdydek commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Closes #

⚠️ Breaking changes ⚠️

Introduced changes

  • media element node was written on the old engine and since the new engine implementation, behavior slightly drifted from perfection this pr aims to bring the node to correct behavior and cleanup some of its insides
  • as per spec says when the media element node is connected to the audio tag it takes over its output and it is not given back even when the node is disconnected
  • now the relationship with the audio tag and media element node is done via simple connect and disconnect methods
  • media element node was indestructible, because of the stale destruction condition
  • media element node captured the file source node by raw ptr and even if the file source node was destructed, by the next render quantum this memory would be read resulting in use after free
  • media element node was not persisted across the replays, because after ending new underlying node was created, but the connection was not refreshed

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage
  • Added support for web
  • Updated old arch android spec file

@mdydek mdydek added the refactor Code restructuring without altering external behavior or fixing bugs label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

WPT non-regression comparison

PASS — no regressions · 0 improved section(s) · overall 3431 → 3431 (0)

Unchanged sections (28)
Spec section Base pass Head pass Delta
Processing model 1 1 0
Other 56 56 0
AnalyserNode 138 138 0
AudioBuffer 142 142 0
AudioBufferSourceNode 221 221 0
AudioContext 58 58 0
AudioNode 261 261 0
AudioParam 680 680 0
BiquadFilterNode 275 275 0
ChannelMergerNode 30 30 0
ChannelSplitterNode 7 7 0
ConstantSourceNode 64 64 0
ConvolverNode 179 179 0
DelayNode 127 127 0
DestinationNode 0 0 0
DynamicsCompressorNode 4 4 0
GainNode 15 15 0
IIRFilterNode 87 87 0
MediaElementAudioSourceNode 0 0 0
MediaStreamAudioDestinationNode 1 1 0
MediaStreamAudioSourceNode 0 0 0
OfflineAudioContext 35 35 0
OscillatorNode 104 104 0
PannerNode 727 727 0
PeriodicWave 33 33 0
ScriptProcessorNode 0 0 0
StereoPannerNode 104 104 0
WaveShaperNode 82 82 0

Baseline: aa5580fe672bde5838ce58b5a82a666d3f29653b · Candidate: cd7670b6d8fe60f52e24178c37e953fb028f5181

Workflow run · this comment is updated on every push.

@github-actions github-actions Bot added the conflicts This PR has conflicts with the base branch. label Nov 16, 2026
@github-actions github-actions Bot removed the conflicts This PR has conflicts with the base branch. label Nov 16, 2026
@mdydek
mdydek merged commit fed8ffa into main Nov 17, 2026
24 of 26 checks passed
@mdydek
mdydek deleted the refactor/simpler-media-element-audio-source-node branch November 17, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without altering external behavior or fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants