Skip to content

Commit

Permalink
Cherry-pick 272605@main (087cd69). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=266758

    [MSE][GStreamer] Fix releasing Stream and GstStream objects
    https://bugs.webkit.org/show_bug.cgi?id=266758

    Reviewed by Philippe Normand.

    There was a circular reference between WebKitMediaSrcPadPrivate which
    owns a RefPtr<Stream>, and Stream which owns a GRefPtr<GstPad> const pad.

    * Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
    (webKitMediaSrcTearDownStream):

    Canonical link: https://commits.webkit.org/272605@main
  • Loading branch information
blino authored and aperezdc committed Jan 28, 2024
1 parent 80ed64c commit fbca3a6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,11 @@ static void webKitMediaSrcTearDownStream(WebKitMediaSrc* source, const AtomStrin
// Stop the thread now.
gst_pad_set_active(stream->pad.get(), false);

if (source->priv->isStarted())
gst_element_remove_pad(GST_ELEMENT(source), stream->pad.get());
if (source->priv->isStarted()) {
WebKitMediaSrcPad* pad = WEBKIT_MEDIA_SRC_PAD(stream->pad.get());
gst_element_remove_pad(GST_ELEMENT(source), GST_PAD(pad));
pad->priv->stream = nullptr;
}
source->priv->streams.remove(name);
}

Expand Down

0 comments on commit fbca3a6

Please sign in to comment.