electron/patches/common/chromium/mas-audiodeviceduck.patch

48 lines
1.4 KiB
Diff
Raw Normal View History

From d322e351554a4fa1fbaf529769416041031f07e9 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Mon, 6 Aug 2018 13:02:53 -0700
Subject: fix: [mas] don't call private api AudioDeviceDuck
---
media/audio/mac/audio_low_latency_input_mac.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index 173167b54dfb..1c0fda354d03 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -28,12 +28,14 @@
namespace {
extern "C" {
+#ifndef MAS_BUILD
// See:
// https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/PAL/pal/spi/cf/CoreAudioSPI.h?rev=228264
OSStatus AudioDeviceDuck(AudioDeviceID inDevice,
Float32 inDuckedLevel,
const AudioTimeStamp* __nullable inStartTime,
Float32 inRampDuration) __attribute__((weak_import));
+#endif
}
} // namespace
@@ -604,6 +606,7 @@ bool AUAudioInputStream::OpenVoiceProcessingAU() {
return false;
}
+#ifndef MAS_BUILD
if (AudioDeviceDuck != nullptr) {
// Undo the ducking.
// Obtain the AudioDeviceID of the default output AudioDevice.
@@ -619,6 +622,7 @@ bool AUAudioInputStream::OpenVoiceProcessingAU() {
AudioDeviceDuck(output_device, 1.0, nullptr, 0.5);
}
}
+#endif
return true;
}
--
2.17.0