electron/patches/common/chromium/mas-audiodeviceduck.patch
Jeremy Apthorp 76c5f5cc8a
build: move libcc patches to electron repo (#14104)
In the GN build, libchromiumcontent is no longer a distinct library, but
merely a container for a set of scripts and patches. Maintaining those
patches in a separate repository is tedious and error-prone, so merge
them into the main repo.

Once this is merged and GN is the default way to build Electron, the
libchromiumcontent repository can be archived.
2018-09-13 22:02:16 -07:00

47 lines
1.4 KiB
Diff

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