Title: [183097] trunk/Source/WebCore
- Revision
- 183097
- Author
- [email protected]
- Date
- 2015-04-21 22:10:39 -0700 (Tue, 21 Apr 2015)
Log Message
[Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
https://bugs.webkit.org/show_bug.cgi?id=144023
Reviewed by Eric Carlson.
Fixes non-deterministic crash in media/media-source/media-source-stalled-holds-sleep-assertion.html.
Platform changes have introduced a re-entrancy to provideMediaData(). Calling
SourceBufferPrivate::enqueueSample() can result in a re-entrant call back into
SourceBuffer::provideMediaData(). To protect against this, wrap the client call
from SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples() to
SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples() in a dispatch_async() to the
main thread. This gives the original provideMediaData() a chance to finish before the next
one begins.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (183096 => 183097)
--- trunk/Source/WebCore/ChangeLog 2015-04-22 04:06:57 UTC (rev 183096)
+++ trunk/Source/WebCore/ChangeLog 2015-04-22 05:10:39 UTC (rev 183097)
@@ -1,3 +1,23 @@
+2015-04-21 Jer Noble <[email protected]>
+
+ [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
+ https://bugs.webkit.org/show_bug.cgi?id=144023
+
+ Reviewed by Eric Carlson.
+
+ Fixes non-deterministic crash in media/media-source/media-source-stalled-holds-sleep-assertion.html.
+
+ Platform changes have introduced a re-entrancy to provideMediaData(). Calling
+ SourceBufferPrivate::enqueueSample() can result in a re-entrant call back into
+ SourceBuffer::provideMediaData(). To protect against this, wrap the client call
+ from SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples() to
+ SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples() in a dispatch_async() to the
+ main thread. This gives the original provideMediaData() a chance to finish before the next
+ one begins.
+
+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+ (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
+
2015-04-21 Eric Carlson <[email protected]>
[Mac] Use one playback target for all web processes
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (183096 => 183097)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2015-04-22 04:06:57 UTC (rev 183096)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2015-04-22 05:10:39 UTC (rev 183097)
@@ -1087,8 +1087,13 @@
return;
}
- if (m_client)
- m_client->sourceBufferPrivateDidBecomeReadyForMoreSamples(this, AtomicString::number(trackID));
+ // FIXME(rdar://problem/20635969): Remove this dispatch_async() when the aforementioned radar is resolved
+ auto weakThis = createWeakPtr();
+ dispatch_async(dispatch_get_main_queue(), [weakThis, trackID] {
+ if (!weakThis || !weakThis->m_client)
+ return;
+ weakThis->m_client->sourceBufferPrivateDidBecomeReadyForMoreSamples(weakThis.get(), AtomicString::number(trackID));
+ });
}
void SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples(AtomicString trackIDString)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes