Bug 1269165 - Restore ALSA plugins detection on non-Linux after bug 757637. r=jesup a=ritu
authorJan Beich <jbeich@FreeBSD.org>
Sat, 30 Apr 2016 21:52:00 -0400
changeset 326201 16291dce26a20da5036ff92a04151d1995c95d30
parent 326200 3ea4c28099c532e6b3cff46265627364f301f496
child 326202 845ee0a38186e90851c3d7ee49ac83da1aea3b7e
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, ritu
bugs1269165, 757637
milestone47.0
Bug 1269165 - Restore ALSA plugins detection on non-Linux after bug 757637. r=jesup a=ritu
media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
--- a/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
@@ -1747,17 +1747,19 @@ int32_t AudioDeviceLinuxALSA::GetDevices
     int enumCount(0);
     bool keepSearching(true);
 
     // From Chromium issue 95797
     // Loop through the sound cards to get Alsa device hints.
     // Don't use snd_device_name_hint(-1,..) since there is a access violation
     // inside this ALSA API with libasound.so.2.0.0.
     int card = -1;
+#ifdef WEBRTC_LINUX
     while (!(LATE(snd_card_next)(&card)) && (card >= 0) && keepSearching) {
+#endif
         void **hints;
         err = LATE(snd_device_name_hint)(card, "pcm", &hints);
         if (err != 0)
         {
             WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
                          "GetDevicesInfo - device name hint error: %s",
                          LATE(snd_strerror)(err));
             return -1;
@@ -1873,17 +1875,19 @@ int32_t AudioDeviceLinuxALSA::GetDevices
         err = LATE(snd_device_name_free_hint)(hints);
         if (err != 0)
         {
             WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
                          "GetDevicesInfo - device name free hint error: %s",
                          LATE(snd_strerror)(err));
             // Continue and return true anyway, since we did get the whole list.
         }
+#ifdef WEBRTC_LINUX
       }
+#endif
 
     if (FUNC_GET_NUM_OF_DEVICE == function)
     {
         if (enumCount == 1) // only default?
             enumCount = 0;
         return enumCount; // Normal return point for function 0
     }