aboutsummaryrefslogtreecommitdiff
path: root/www/iridium/files/patch-media__audio__alsa__audio_manager_alsa.cc
diff options
context:
space:
mode:
Diffstat (limited to 'www/iridium/files/patch-media__audio__alsa__audio_manager_alsa.cc')
-rw-r--r--www/iridium/files/patch-media__audio__alsa__audio_manager_alsa.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/www/iridium/files/patch-media__audio__alsa__audio_manager_alsa.cc b/www/iridium/files/patch-media__audio__alsa__audio_manager_alsa.cc
new file mode 100644
index 000000000000..09239026a2d9
--- /dev/null
+++ b/www/iridium/files/patch-media__audio__alsa__audio_manager_alsa.cc
@@ -0,0 +1,54 @@
+--- media/audio/alsa/audio_manager_alsa.cc.orig 2017-04-19 19:06:35 UTC
++++ media/audio/alsa/audio_manager_alsa.cc
+@@ -138,7 +138,9 @@ void AudioManagerAlsa::GetAlsaAudioDevic
+ int card = -1;
+
+ // Loop through the sound cards to get ALSA device hints.
++#ifdef OS_LINUX
+ while (!wrapper_->CardNext(&card) && card >= 0) {
++#endif
+ void** hints = NULL;
+ int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints);
+ if (!error) {
+@@ -150,7 +152,9 @@ void AudioManagerAlsa::GetAlsaAudioDevic
+ DLOG(WARNING) << "GetAlsaAudioDevices: unable to get device hints: "
+ << wrapper_->StrError(error);
+ }
++#ifdef OS_LINUX
+ }
++#endif
+ }
+
+ void AudioManagerAlsa::GetAlsaDevicesInfo(AudioManagerAlsa::StreamType type,
+@@ -232,7 +236,11 @@ bool AudioManagerAlsa::IsAlsaDeviceAvail
+ // goes through software conversion if needed (e.g. incompatible
+ // sample rate).
+ // TODO(joi): Should we prefer "hw" instead?
++#ifdef OS_LINUX
+ static const char kDeviceTypeDesired[] = "plughw";
++#else
++ static const char kDeviceTypeDesired[] = "plug";
++#endif
+ return strncmp(kDeviceTypeDesired,
+ device_name,
+ arraysize(kDeviceTypeDesired) - 1) == 0;
+@@ -256,7 +264,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDe
+ // Loop through the sound cards.
+ // Don't use snd_device_name_hint(-1,..) since there is a access violation
+ // inside this ALSA API with libasound.so.2.0.0.
++#ifdef OS_LINUX
+ while (!wrapper_->CardNext(&card) && (card >= 0) && !has_device) {
++#endif
+ int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints);
+ if (!error) {
+ for (void** hint_iter = hints; *hint_iter != NULL; hint_iter++) {
+@@ -280,7 +290,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDe
+ DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: "
+ << wrapper_->StrError(error);
+ }
++#ifdef OS_LINUX
+ }
++#endif
+
+ return has_device;
+ }