Title: [289293] branches/safari-613-branch/Source/WebCore
- Revision
- 289293
- Author
- [email protected]
- Date
- 2022-02-07 18:54:35 -0800 (Mon, 07 Feb 2022)
Log Message
Cherry-pick r288439. rdar://problem/88592095
Reconfiguring the CoreAudioSharedUnit should take into account that there is a speaker sample producer
https://bugs.webkit.org/show_bug.cgi?id=235397
<rdar://problem/87819949>
Reviewed by Eric Carlson and Geoff Garen.
Address post-commit comments.
Introduce a boolean to make high priority thread callbacks no-ops when reconfiguring the audio unit.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (289292 => 289293)
--- branches/safari-613-branch/Source/WebCore/ChangeLog 2022-02-08 02:54:32 UTC (rev 289292)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog 2022-02-08 02:54:35 UTC (rev 289293)
@@ -1,5 +1,36 @@
2022-02-07 Russell Epstein <[email protected]>
+ Cherry-pick r288439. rdar://problem/88592095
+
+ Reconfiguring the CoreAudioSharedUnit should take into account that there is a speaker sample producer
+ https://bugs.webkit.org/show_bug.cgi?id=235397
+ <rdar://problem/87819949>
+
+ Reviewed by Eric Carlson and Geoff Garen.
+
+ Address post-commit comments.
+ Introduce a boolean to make high priority thread callbacks no-ops when reconfiguring the audio unit.
+
+ * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-01-24 Youenn Fablet <[email protected]>
+
+ Reconfiguring the CoreAudioSharedUnit should take into account that there is a speaker sample producer
+ https://bugs.webkit.org/show_bug.cgi?id=235397
+ <rdar://problem/87819949>
+
+ Reviewed by Eric Carlson and Geoff Garen.
+
+ Address post-commit comments.
+ Introduce a boolean to make high priority thread callbacks no-ops when reconfiguring the audio unit.
+
+ * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+
+2022-02-07 Russell Epstein <[email protected]>
+
Cherry-pick r288362. rdar://problem/87832940
WPT version of css/css-cascade/parsing/layer-import-parsing.html crashes with nullptr
Modified: branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (289292 => 289293)
--- branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp 2022-02-08 02:54:32 UTC (rev 289292)
+++ branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp 2022-02-08 02:54:35 UTC (rev 289293)
@@ -49,6 +49,7 @@
#include <wtf/Lock.h>
#include <wtf/MainThread.h>
#include <wtf/NeverDestroyed.h>
+#include <wtf/Scope.h>
#include <pal/cf/AudioToolboxSoftLink.h>
#include <pal/cf/CoreMediaSoftLink.h>
@@ -146,6 +147,7 @@
uint64_t m_microphoneProcsCalledLastTime { 0 };
Timer m_verifyCapturingTimer;
+ bool m_isReconfiguring { false };
Lock m_speakerSamplesProducerLock;
CoreAudioSpeakerSamplesProducer* m_speakerSamplesProducer WTF_GUARDED_BY_LOCK(m_speakerSamplesProducerLock) { nullptr };
};
@@ -354,7 +356,7 @@
OSStatus CoreAudioSharedUnit::provideSpeakerData(AudioUnitRenderActionFlags& flags, const AudioTimeStamp& timeStamp, UInt32 /*inBusNumber*/, UInt32 inNumberFrames, AudioBufferList& ioData)
{
- if (!m_speakerSamplesProducerLock.tryLock()) {
+ if (m_isReconfiguring || !m_speakerSamplesProducerLock.tryLock()) {
AudioSampleBufferList::zeroABL(ioData, static_cast<size_t>(inNumberFrames * m_speakerProcFormat.bytesPerFrame()));
flags = kAudioUnitRenderAction_OutputIsSilence;
return noErr;
@@ -379,6 +381,11 @@
OSStatus CoreAudioSharedUnit::processMicrophoneSamples(AudioUnitRenderActionFlags& ioActionFlags, const AudioTimeStamp& timeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList* /*ioData*/)
{
+ ++m_microphoneProcsCalled;
+
+ if (m_isReconfiguring)
+ return false;
+
// Pull through the vpio unit to our mic buffer.
m_microphoneSampleBuffer->reset();
AudioBufferList& bufferList = m_microphoneSampleBuffer->bufferList();
@@ -395,8 +402,6 @@
return err;
}
- ++m_microphoneProcsCalled;
-
if (!isProducingMicrophoneSamples())
return noErr;
@@ -450,6 +455,9 @@
if (!hasAudioUnit())
return 0;
+ m_isReconfiguring = true;
+ auto scope = makeScopeExit([this] { m_isReconfiguring = false; });
+
if (m_ioUnitStarted) {
err = PAL::AudioOutputUnitStop(m_ioUnit);
if (err) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes