Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 94bb75608bebf2dc579580ea5a67ae563173d0af
      
https://github.com/WebKit/WebKit/commit/94bb75608bebf2dc579580ea5a67ae563173d0af
  Author: Alicia Boya Garcia <[email protected]>
  Date:   2025-11-06 (Thu, 06 Nov 2025)

  Changed paths:
    M 
Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp

  Log Message:
  -----------
  [WebRTC][GStreamer] Fix deadlock in WebKitMediaStream that hung tests
https://bugs.webkit.org/show_bug.cgi?id=302012

Reviewed by Philippe Normand.

When running a certain subset of tests including some WebRTC tests the
test runner was hanging up. Upon investigation I found the following
deadlock around an appsrc of WebKitMediaStreamSrc.

T1: gst_task_join() <- gst_pad_finalize() <- gst_element_remove_pad()
T2: gst_base_src_loop()

The root cause was a premature pad activation in
webkitMediaStreamSrcAddTrack(), where gst_pad_set_active(pad, TRUE) was
being called even when the element was in state < PAUSED.

Note that normally pad activation occurs internally as a result of state
changes, as seen in gst_element_change_state_func().

If the element was later disposed without ever reaching PAUSED, no state
changes would be involved, and therefore no GStreamer code would
deactivate the pad, leading to the deadlock.

This patch fixes the deadlock by removing the manual calls to
gst_pad_set_active() in webkitMediaStreamSrcAddTrack() and instead
letting GStreamer perform them internally during state transitions as
needed.

* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcAddTrack):

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



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

Reply via email to