Skip to content

Commit

Permalink
[GStreamer][MSE][Debug] Flaky crashes during GC of SourceBufferPrivate
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265105

Reviewed by Xabier Rodriguez-Calvar.

Settle a result on the appendPromise before disposal, otherwise we hit an ASSERT(!isNothing()) in
the NativePromise destructor.

* Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer):
* Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

Canonical link: https://commits.webkit.org/270968@main
  • Loading branch information
philn committed Nov 20, 2023
1 parent d6decd3 commit 217f2ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer(MediaSourcePrivateGSt
{
}

SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer()
{
if (!m_appendPromise)
return;

m_appendPromise->reject(PlatformMediaError::BufferRemoved);
m_appendPromise.reset();
}

Ref<MediaPromise> SourceBufferPrivateGStreamer::appendInternal(Ref<SharedBuffer>&& data)
{
ASSERT(isMainThread());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SourceBufferPrivateGStreamer final : public SourceBufferPrivate {
public:
static bool isContentTypeSupported(const ContentType&);
static Ref<SourceBufferPrivateGStreamer> create(MediaSourcePrivateGStreamer&, const ContentType&, MediaPlayerPrivateGStreamerMSE&);
virtual ~SourceBufferPrivateGStreamer() = default;
~SourceBufferPrivateGStreamer();

constexpr PlatformType platformType() const final { return PlatformType::GStreamer; }

Expand Down

0 comments on commit 217f2ea

Please sign in to comment.