Title: [227034] branches/safari-605-branch/Source/WebCore
Revision
227034
Author
[email protected]
Date
2018-01-16 21:04:41 -0800 (Tue, 16 Jan 2018)

Log Message

Cherry-pick r226982. rdar://problem/36567983

Modified Paths

Diff

Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227033 => 227034)


--- branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-17 05:04:39 UTC (rev 227033)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-17 05:04:41 UTC (rev 227034)
@@ -1,5 +1,24 @@
 2018-01-16  Jason Marcell  <[email protected]>
 
+        Cherry-pick r226982. rdar://problem/36567983
+
+    2018-01-16  Jer Noble  <[email protected]>
+
+            Crash playing audio-only HLS stream via hls.js (MSE)
+            https://bugs.webkit.org/show_bug.cgi?id=181691
+            <rdar://problem/32967295>
+
+            Reviewed by Eric Carlson.
+
+            Add a weak-link check to the block called by -[AVSampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:usingBlock:].
+
+            * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+            (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
+            (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
+            (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
+
+2018-01-16  Jason Marcell  <[email protected]>
+
         Cherry-pick r226951. rdar://problem/36568098
 
     2018-01-15  Youenn Fablet  <[email protected]>

Modified: branches/safari-605-branch/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (227033 => 227034)


--- branches/safari-605-branch/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2018-01-17 05:04:39 UTC (rev 227033)
+++ branches/safari-605-branch/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2018-01-17 05:04:41 UTC (rev 227034)
@@ -874,8 +874,10 @@
 #pragma clang diagnostic pop
         if (!m_audioRenderers.contains(trackID)) {
             renderer = adoptNS([allocAVSampleBufferAudioRendererInstance() init]);
+            auto weakThis = createWeakPtr();
             [renderer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^{
-                didBecomeReadyForMoreSamples(trackID);
+                if (weakThis)
+                    weakThis->didBecomeReadyForMoreSamples(trackID);
             }];
             m_audioRenderers.set(trackID, renderer);
             [m_errorListener beginObservingRenderer:renderer.get()];
@@ -1176,13 +1178,17 @@
             });
         }
         if (m_displayLayer) {
+            auto weakThis = createWeakPtr();
             [m_displayLayer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^ {
-                didBecomeReadyForMoreSamples(trackID);
+                if (weakThis)
+                    weakThis->didBecomeReadyForMoreSamples(trackID);
             }];
         }
     } else if (m_audioRenderers.contains(trackID)) {
+        auto weakThis = createWeakPtr();
         [m_audioRenderers.get(trackID) requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^ {
-            didBecomeReadyForMoreSamples(trackID);
+            if (weakThis)
+                weakThis->didBecomeReadyForMoreSamples(trackID);
         }];
     }
 }
@@ -1203,8 +1209,10 @@
     m_displayLayer = layer;
 
     if (m_displayLayer) {
+        auto weakThis = createWeakPtr();
         [m_displayLayer requestMediaDataWhenReadyOnQueue:dispatch_get_main_queue() usingBlock:^ {
-            didBecomeReadyForMoreSamples(m_enabledVideoTrackID);
+            if (weakThis)
+                weakThis->didBecomeReadyForMoreSamples(m_enabledVideoTrackID);
         }];
         [m_errorListener beginObservingLayer:m_displayLayer.get()];
         if (m_client)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to