Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c8cef76f94bc80b9d5d50e17a2074e80fbb1366d
      
https://github.com/WebKit/WebKit/commit/c8cef76f94bc80b9d5d50e17a2074e80fbb1366d
  Author: Chris Dumez <[email protected]>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing-expected.txt
    M Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp
    M 
Source/WebCore/platform/mediastream/cocoa/MediaStreamTrackAudioSourceProviderCocoa.cpp
    M 
Source/WebCore/platform/mediastream/cocoa/MediaStreamTrackAudioSourceProviderCocoa.h

  Log Message:
  -----------
  MediaStreamAudioSourceNode captures the wrong track and keeps playing after 
the track ends
https://bugs.webkit.org/show_bug.cgi?id=321059

Reviewed by Darin Adler.

The imported WPT test mediastreamaudiosourcenode-routing.html was timing
out. Two separate bugs were responsible:

  1. Track selection did not follow the spec. Per the MediaStreamAudioSourceNode
     constructor algorithm [1], the input track is the first audio track after
     sorting the tracks by their id using a code unit ordering. We instead 
picked
     the first track in getAudioTracks() insertion order, so with random track
     ids we captured the wrong track roughly half the time.

  2. Stopping the captured track did not silence the node. The Cocoa audio 
source
     provider's trackEnded() override was empty, so once the track ended the
     provider kept pulling samples from the still-running source instead of
     outputting silence.

No new tests, unskipped WPT test that is now passing (used to time out).

[1] https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing-expected.txt:
 Added.
* Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::create):
* 
Source/WebCore/platform/mediastream/cocoa/MediaStreamTrackAudioSourceProviderCocoa.cpp:
(WebCore::MediaStreamTrackAudioSourceProviderCocoa::trackEnded):
(WebCore::MediaStreamTrackAudioSourceProviderCocoa::provideInput):
* 
Source/WebCore/platform/mediastream/cocoa/MediaStreamTrackAudioSourceProviderCocoa.h:

Canonical link: https://commits.webkit.org/318706@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to