[webkit-changes] [WebKit/WebKit] 0f803e: Fix incorrect storage of AudioSourceProviderGStreamer

Michael Catanzaro noreply at github.com
Mon Nov 6 07:31:10 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0f803ec2d5e6630eb8915594772e31036d460537
      https://github.com/WebKit/WebKit/commit/0f803ec2d5e6630eb8915594772e31036d460537
  Author: Michael Catanzaro <mcatanzaro at redhat.com>
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
    M Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.h
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

  Log Message:
  -----------
  Fix incorrect storage of AudioSourceProviderGStreamer
https://bugs.webkit.org/show_bug.cgi?id=264119

Reviewed by Xabier Rodriguez-Calvar and Philippe Normand

We cannot store refcounted objects in a std::unique_ptr since the object
may be deleted with an outstanding reference.

Part of the problem here is that AudioSourceProviderGStreamer may or may
not be a refcounted object depending on whether ENABLE(MEDIA_STREAM) is
used. If disabled, then it inherits from AudioSourceProvider, which is
not refcounted. If enabled, then it inherits from
WebAudioSourceProvider, which just adds refcounting and nothing else.
There is no reason this should be dependent on the value of
ENABLE(MEDIA_STREAM) so we can just always inherit from
WebAudioSourceProvider.

* Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::ensureAudioSourceProvider):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

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




More information about the webkit-changes mailing list