Title: [219435] trunk/Source/WebCore
Revision
219435
Author
commit-qu...@webkit.org
Date
2017-07-12 17:03:37 -0700 (Wed, 12 Jul 2017)

Log Message

Recreate the AudioUnit when restarting capture
https://bugs.webkit.org/show_bug.cgi?id=174439

Patch by Youenn Fablet <you...@apple.com> on 2017-07-12
Reviewed by Jer Noble.

Sometimes other applications in the system like FaceTime may make the audio unit not functional.
Reloading the tab capturing audio will trigger a call to stop the audio shared unit.
When the tab requests again audio, the shared unit will restart.
At that time, the AudioUnit shared unit will be fully recreated.

Manually tested by doing a webrtc call and then doing a FaceTime call.
Remote WebRTC endpoints may not receive any audio.
With the patch, reloading the web page will get back the audio.
Previously, restarting the UIProcess was the only way.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::startProducingData): Cleaning the audio unit when starting to produce data if there is a preexisting audio unit.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219434 => 219435)


--- trunk/Source/WebCore/ChangeLog	2017-07-12 23:50:01 UTC (rev 219434)
+++ trunk/Source/WebCore/ChangeLog	2017-07-13 00:03:37 UTC (rev 219435)
@@ -1,5 +1,25 @@
 2017-07-12  Youenn Fablet  <you...@apple.com>
 
+        Recreate the AudioUnit when restarting capture
+        https://bugs.webkit.org/show_bug.cgi?id=174439
+
+        Reviewed by Jer Noble.
+
+        Sometimes other applications in the system like FaceTime may make the audio unit not functional.
+        Reloading the tab capturing audio will trigger a call to stop the audio shared unit.
+        When the tab requests again audio, the shared unit will restart.
+        At that time, the AudioUnit shared unit will be fully recreated.
+
+        Manually tested by doing a webrtc call and then doing a FaceTime call.
+        Remote WebRTC endpoints may not receive any audio.
+        With the patch, reloading the web page will get back the audio.
+        Previously, restarting the UIProcess was the only way.
+
+        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+        (WebCore::CoreAudioSharedUnit::startProducingData): Cleaning the audio unit when starting to produce data if there is a preexisting audio unit.
+
+2017-07-12  Youenn Fablet  <you...@apple.com>
+
         Accessing localDescription, remoteDescription, etc. after setTimeout raises EXC_BAD_ACCESS
         https://bugs.webkit.org/show_bug.cgi?id=174323
         <rdar://problem/33267876>

Modified: trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (219434 => 219435)


--- trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2017-07-12 23:50:01 UTC (rev 219434)
+++ trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2017-07-13 00:03:37 UTC (rev 219435)
@@ -543,6 +543,11 @@
     if (m_ioUnitStarted)
         return;
 
+    if (m_ioUnit) {
+        cleanupAudioUnit();
+        ASSERT(!m_ioUnit);
+    }
+
     startInternal();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to