[GStreamer][MSE] Add missing lock around getStreamByTrackId
[WebKit-https.git] / Source / WebCore / platform / graphics / gstreamer / mse / PlaybackPipeline.cpp
index 8a2ff43acabb2b9d097bb22e25a636baaaef9fda..3fe62cf5973f45dc56f3e6526c84ec0399b49894 100644 (file)
@@ -488,6 +488,7 @@ void PlaybackPipeline::enqueueSample(Ref<MediaSample>&& mediaSample)
         GST_TIME_ARGS(WebCore::toGstClockTime(mediaSample->presentationTime().toDouble())),
         GST_TIME_ARGS(WebCore::toGstClockTime(mediaSample->duration().toDouble())));
 
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(m_webKitMediaSrc.get()));
     Stream* stream = getStreamByTrackId(m_webKitMediaSrc.get(), trackId);
 
     if (!stream) {