Modified: branches/safari-537.60-branch/Source/WebCore/ChangeLog (169855 => 169856)
--- branches/safari-537.60-branch/Source/WebCore/ChangeLog 2014-06-11 23:12:30 UTC (rev 169855)
+++ branches/safari-537.60-branch/Source/WebCore/ChangeLog 2014-06-11 23:17:06 UTC (rev 169856)
@@ -1,3 +1,26 @@
+2014-06-11 Brent Fulgham <[email protected]>
+
+ Merge r169842.
+
+ 2014-06-11 Brent Fulgham <[email protected]>
+
+ [Win] Avoid deadlock with AVFoundation
+ https://bugs.webkit.org/show_bug.cgi?id=133762
+ <rdar://problem/17128248>
+
+ Reviewed by Eric Carlson.
+
+ Always invoke our notifications asynchronously so that we do not
+ execute long-running code while holding the AVFWrapper map mutex
+ lock. AVFoundationCF callbacks can deadlock if we call into AVF
+ while holding this lock.
+
+
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::AVFWrapper::legibleOutputCallback): Correct bad assertion.
+
2014-05-06 Lucas Forschler <[email protected]>
Merge r165790 (165753)
Modified: branches/safari-537.60-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (169855 => 169856)
--- branches/safari-537.60-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2014-06-11 23:12:30 UTC (rev 169855)
+++ branches/safari-537.60-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2014-06-11 23:17:06 UTC (rev 169856)
@@ -754,7 +754,11 @@
// so always go through the queue because notifications happen on different threads.
m_queuedNotifications.append(notification);
+#if PLATFORM(WIN)
+ bool delayDispatch = true;
+#else
bool delayDispatch = m_delayCallbacks || !isMainThread();
+#endif
if (delayDispatch && !m_mainThreadCallPending) {
m_mainThreadCallPending = true;
callOnMainThread(mainThreadCallback, this);
Modified: branches/safari-537.60-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (169855 => 169856)
--- branches/safari-537.60-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2014-06-11 23:12:30 UTC (rev 169855)
+++ branches/safari-537.60-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2014-06-11 23:17:06 UTC (rev 169856)
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -1614,7 +1614,7 @@
void AVFWrapper::legibleOutputCallback(void* context, AVCFPlayerItemLegibleOutputRef legibleOutput, CFArrayRef attributedStrings, CFArrayRef /*nativeSampleBuffers*/, CMTime itemTime)
{
- ASSERT(dispatch_get_main_queue() == dispatch_get_current_queue());
+ ASSERT(dispatch_get_main_queue() != dispatch_get_current_queue());
MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(context);
if (!self) {