Title: [276893] trunk/Source/WebCore
Revision
276893
Author
[email protected]
Date
2021-05-03 01:16:13 -0700 (Mon, 03 May 2021)

Log Message

REGRESSION (r276633): fast/mediastream/media-stream-track-interrupted.html is consistently timing out
https://bugs.webkit.org/show_bug.cgi?id=225204
<rdar://problem/77338070>

Reviewed by Eric Carlson.

Reverting to RecursiveLock since resuming a unit will make it notify to unmute sources.
Sources will want to restart audio, thus restarting the unit synchronously.
This triggers the unit to tell its clients that it is restarting, which creates a dead lock.
We should probably update the code to change this, but as a short term fix, we revert to a RecursiveLock.

Covered by fast/mediastream/media-stream-track-interrupted.html no longer timing out.

* platform/mediastream/mac/BaseAudioSharedUnit.cpp:
(WebCore::BaseAudioSharedUnit::audioSamplesAvailable):
* platform/mediastream/mac/BaseAudioSharedUnit.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (276892 => 276893)


--- trunk/Source/WebCore/ChangeLog	2021-05-03 08:12:49 UTC (rev 276892)
+++ trunk/Source/WebCore/ChangeLog	2021-05-03 08:16:13 UTC (rev 276893)
@@ -1,5 +1,24 @@
 2021-05-03  Youenn Fablet  <[email protected]>
 
+        REGRESSION (r276633): fast/mediastream/media-stream-track-interrupted.html is consistently timing out
+        https://bugs.webkit.org/show_bug.cgi?id=225204
+        <rdar://problem/77338070>
+
+        Reviewed by Eric Carlson.
+
+        Reverting to RecursiveLock since resuming a unit will make it notify to unmute sources.
+        Sources will want to restart audio, thus restarting the unit synchronously.
+        This triggers the unit to tell its clients that it is restarting, which creates a dead lock.
+        We should probably update the code to change this, but as a short term fix, we revert to a RecursiveLock.
+
+        Covered by fast/mediastream/media-stream-track-interrupted.html no longer timing out.
+
+        * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
+        (WebCore::BaseAudioSharedUnit::audioSamplesAvailable):
+        * platform/mediastream/mac/BaseAudioSharedUnit.h:
+
+2021-05-03  Youenn Fablet  <[email protected]>
+
         Use OptionSet for MediaProducer::MutedStateFlags
         https://bugs.webkit.org/show_bug.cgi?id=224550
         <rdar://problem/76960294>

Modified: trunk/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp (276892 => 276893)


--- trunk/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp	2021-05-03 08:12:49 UTC (rev 276892)
+++ trunk/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp	2021-05-03 08:16:13 UTC (rev 276893)
@@ -216,11 +216,12 @@
 
 void BaseAudioSharedUnit::audioSamplesAvailable(const MediaTime& time, const PlatformAudioData& data, const AudioStreamDescription& description, size_t numberOfFrames)
 {
+    // We hold the lock here since adding/removing clients can only happen in main thread.
+    auto locker = holdLock(m_clientsLock);
+
     // For performance reasons, we forbid heap allocations while doing rendering on the capture audio thread.
     ForbidMallocUseForCurrentThreadScope forbidMallocUse;
 
-    // We hold the lock here since adding/removing clients can only happen in main thread.
-    auto locker = holdLock(m_clientsLock);
     for (auto* client : m_clients) {
         if (client->isProducingData())
             client->audioSamplesAvailable(time, data, description, numberOfFrames);

Modified: trunk/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h (276892 => 276893)


--- trunk/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h	2021-05-03 08:12:49 UTC (rev 276892)
+++ trunk/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h	2021-05-03 08:16:13 UTC (rev 276893)
@@ -30,8 +30,8 @@
 #include "RealtimeMediaSourceCapabilities.h"
 #include <wtf/Function.h>
 #include <wtf/HashSet.h>
-#include <wtf/Lock.h>
 #include <wtf/MediaTime.h>
+#include <wtf/RecursiveLockAdapter.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -103,7 +103,7 @@
     int32_t m_producingCount { 0 };
 
     HashSet<CoreAudioCaptureSource*> m_clients;
-    mutable Lock m_clientsLock;
+    mutable RecursiveLock m_clientsLock;
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to