| Server IP : 82.208.35.60 / Your IP : 216.73.216.89 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/www/iridium/files/ |
Upload File : |
--- media/audio/alsa/audio_manager_alsa.cc.orig 2022-10-05 07:34:01 UTC
+++ media/audio/alsa/audio_manager_alsa.cc
@@ -88,7 +88,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType
int card = -1;
// Loop through the sound cards to get ALSA device hints.
+#if !BUILDFLAG(IS_BSD)
while (!wrapper_->CardNext(&card) && card >= 0) {
+#endif
void** hints = NULL;
int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints);
if (!error) {
@@ -100,7 +102,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType
DLOG(WARNING) << "GetAlsaAudioDevices: unable to get device hints: "
<< wrapper_->StrError(error);
}
+#if !BUILDFLAG(IS_BSD)
}
+#endif
}
void AudioManagerAlsa::GetAlsaDevicesInfo(AudioManagerAlsa::StreamType type,
@@ -183,7 +187,11 @@ bool AudioManagerAlsa::IsAlsaDeviceAvailable(
// goes through software conversion if needed (e.g. incompatible
// sample rate).
// TODO(joi): Should we prefer "hw" instead?
+#if BUILDFLAG(IS_BSD)
+ static const char kDeviceTypeDesired[] = "plug";
+#else
static const char kDeviceTypeDesired[] = "plughw";
+#endif
return strncmp(kDeviceTypeDesired, device_name,
std::size(kDeviceTypeDesired) - 1) == 0;
}
@@ -205,7 +213,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice(
// Loop through the sound cards.
// Don't use snd_device_name_hint(-1,..) since there is an access violation
// inside this ALSA API with libasound.so.2.0.0.
+#if !BUILDFLAG(IS_BSD)
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++) {
@@ -229,7 +239,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice(
DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: "
<< wrapper_->StrError(error);
}
+#if !BUILDFLAG(IS_BSD)
}
+#endif
return has_device;
}