MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 19:55:22 +0000 (19:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 19:55:22 +0000 (19:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177016

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-15
Reviewed by Jer Noble.

No change of behavior.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): exciting early in block to prevent enqueueing.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm

index c733fc8..7806edd 100644 (file)
@@ -1,3 +1,15 @@
+2017-09-15  Youenn Fablet  <youenn@apple.com>
+
+        MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should enqueue data if still useful
+        https://bugs.webkit.org/show_bug.cgi?id=177016
+
+        Reviewed by Jer Noble.
+
+        No change of behavior.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): exciting early in block to prevent enqueueing.
+
 2017-09-15  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r222040.
index 52d74d6..c42e462 100644 (file)
@@ -394,7 +394,11 @@ void MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample(MediaStreamTrackPr
 
 void MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData()
 {
+    auto weakThis = createWeakPtr();
     [m_sampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^ {
+        if (!weakThis)
+            return;
+
         [m_sampleBufferDisplayLayer stopRequestingMediaData];
 
         while (!m_pendingVideoSampleQueue.isEmpty()) {