diff --git a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp index 313ebbd3f5b4..74ec2473b7a8 100644 --- a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp +++ b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp @@ -1140,13 +1140,10 @@ void GStreamerMediaEndpoint::resume() void GStreamerMediaEndpoint::onNegotiationNeeded() { - m_isNegotiationNeeded = true; - + ++m_negotiationNeededEventId; callOnMainThread([protectedThis = Ref(*this), this] { - if (isStopped()) - return; GST_DEBUG_OBJECT(m_pipeline.get(), "Negotiation needed!"); - m_peerConnectionBackend.markAsNeedingNegotiation(0); + m_peerConnectionBackend.markAsNeedingNegotiation(m_negotiationNeededEventId); }); } diff --git a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h index b1e9ba285f2b..6e1063afc24f 100644 --- a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h +++ b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h @@ -76,7 +76,7 @@ class GStreamerMediaEndpoint : public ThreadSafeRefCounted&&); - bool isNegotiationNeeded() const { return m_isNegotiationNeeded; } + bool isNegotiationNeeded(uint32_t eventId) const { return eventId == m_negotiationNeededEventId; } void configureAndLinkSource(RealtimeOutgoingMediaSourceGStreamer&); @@ -176,7 +176,7 @@ class GStreamerMediaEndpoint : public ThreadSafeRefCountedgatherDecoderImplementationName(WTFMove(callback)); } -bool GStreamerPeerConnectionBackend::isNegotiationNeeded(uint32_t) const +bool GStreamerPeerConnectionBackend::isNegotiationNeeded(uint32_t eventId) const { - return m_endpoint->isNegotiationNeeded(); + return m_endpoint->isNegotiationNeeded(eventId); } } // namespace WebCore