[GStreamer][MSE] Add missing lock around getStreamByTrackId
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 17:23:16 +0000 (17:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 17:23:16 +0000 (17:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175323

Patch by Charlie Turner <cturner@igalia.com> on 2017-08-09
Reviewed by Xabier Rodriguez-Calvar.

Covered by existing tests.

* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::enqueueSample): Ensure the media source
lock is taken before modifiying the track queues indirectly via the
iterator use in getTrackId.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@220461 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.cpp

index 501800f..4ead7c8 100644 (file)
@@ -1,3 +1,17 @@
+2017-08-09  Charlie Turner  <cturner@igalia.com>
+
+        [GStreamer][MSE] Add missing lock around getStreamByTrackId
+        https://bugs.webkit.org/show_bug.cgi?id=175323
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Covered by existing tests.
+
+        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
+        (WebCore::PlaybackPipeline::enqueueSample): Ensure the media source
+        lock is taken before modifiying the track queues indirectly via the
+        iterator use in getTrackId.
+
 2017-08-09  Daniel Bates  <dabates@apple.com>
 
         REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
index 8a2ff43..3fe62cf 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) {