summaryrefslogtreecommitdiff
path: root/src/modules/alsa/alsa-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/alsa/alsa-util.c')
-rw-r--r--src/modules/alsa/alsa-util.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 168a67884..75f58580a 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -191,17 +191,17 @@ int pa_alsa_set_hw_params(
snd_pcm_uframes_t *period_size,
snd_pcm_uframes_t *buffer_size,
snd_pcm_uframes_t tsched_size,
- pa_bool_t *use_mmap,
- pa_bool_t *use_tsched,
- pa_bool_t require_exact_channel_number) {
+ bool *use_mmap,
+ bool *use_tsched,
+ bool require_exact_channel_number) {
int ret = -1;
snd_pcm_hw_params_t *hwparams, *hwparams_copy;
int dir;
snd_pcm_uframes_t _period_size = period_size ? *period_size : 0;
snd_pcm_uframes_t _buffer_size = buffer_size ? *buffer_size : 0;
- pa_bool_t _use_mmap = use_mmap && *use_mmap;
- pa_bool_t _use_tsched = use_tsched && *use_tsched;
+ bool _use_mmap = use_mmap && *use_mmap;
+ bool _use_tsched = use_tsched && *use_tsched;
pa_sample_spec _ss = *ss;
pa_assert(pcm_handle);
@@ -231,7 +231,7 @@ int pa_alsa_set_hw_params(
goto finish;
}
- _use_mmap = FALSE;
+ _use_mmap = false;
}
} else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
@@ -240,10 +240,10 @@ int pa_alsa_set_hw_params(
}
if (!_use_mmap)
- _use_tsched = FALSE;
+ _use_tsched = false;
if (!pa_alsa_pcm_is_hw(pcm_handle))
- _use_tsched = FALSE;
+ _use_tsched = false;
#if (SND_LIB_VERSION >= ((1<<16)|(0<<8)|24)) /* API additions in 1.0.24 */
if (_use_tsched) {
@@ -251,7 +251,7 @@ int pa_alsa_set_hw_params(
/* try to disable period wakeups if hardware can do so */
if (snd_pcm_hw_params_can_disable_period_wakeup(hwparams)) {
- if ((ret = snd_pcm_hw_params_set_period_wakeup(pcm_handle, hwparams, FALSE)) < 0)
+ if ((ret = snd_pcm_hw_params_set_period_wakeup(pcm_handle, hwparams, false)) < 0)
/* don't bail, keep going with default mode with period wakeups */
pa_log_debug("snd_pcm_hw_params_set_period_wakeup() failed: %s", pa_alsa_strerror(ret));
else
@@ -426,7 +426,7 @@ finish:
return ret;
}
-int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, pa_bool_t period_event) {
+int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, bool period_event) {
snd_pcm_sw_params_t *swparams;
snd_pcm_uframes_t boundary;
int err;
@@ -487,8 +487,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
snd_pcm_uframes_t *period_size,
snd_pcm_uframes_t *buffer_size,
snd_pcm_uframes_t tsched_size,
- pa_bool_t *use_mmap,
- pa_bool_t *use_tsched,
+ bool *use_mmap,
+ bool *use_tsched,
pa_alsa_profile_set *ps,
pa_alsa_mapping **mapping) {
@@ -578,7 +578,7 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
tsched_size,
use_mmap,
use_tsched,
- FALSE);
+ false);
pa_xfree(d);
if (pcm_handle && mapping)
@@ -596,8 +596,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_mapping(
snd_pcm_uframes_t *period_size,
snd_pcm_uframes_t *buffer_size,
snd_pcm_uframes_t tsched_size,
- pa_bool_t *use_mmap,
- pa_bool_t *use_tsched,
+ bool *use_mmap,
+ bool *use_tsched,
pa_alsa_mapping *m) {
snd_pcm_t *pcm_handle;
@@ -648,14 +648,14 @@ snd_pcm_t *pa_alsa_open_by_device_string(
snd_pcm_uframes_t *period_size,
snd_pcm_uframes_t *buffer_size,
snd_pcm_uframes_t tsched_size,
- pa_bool_t *use_mmap,
- pa_bool_t *use_tsched,
- pa_bool_t require_exact_channel_number) {
+ bool *use_mmap,
+ bool *use_tsched,
+ bool require_exact_channel_number) {
int err;
char *d;
snd_pcm_t *pcm_handle;
- pa_bool_t reformat = FALSE;
+ bool reformat = false;
pa_assert(device);
pa_assert(ss);
@@ -688,7 +688,7 @@ snd_pcm_t *pa_alsa_open_by_device_string(
require_exact_channel_number)) < 0) {
if (!reformat) {
- reformat = TRUE;
+ reformat = true;
snd_pcm_close(pcm_handle);
continue;
@@ -702,7 +702,7 @@ snd_pcm_t *pa_alsa_open_by_device_string(
pa_xfree(d);
d = t;
- reformat = FALSE;
+ reformat = false;
snd_pcm_close(pcm_handle);
continue;
@@ -741,9 +741,9 @@ snd_pcm_t *pa_alsa_open_by_template(
snd_pcm_uframes_t *period_size,
snd_pcm_uframes_t *buffer_size,
snd_pcm_uframes_t tsched_size,
- pa_bool_t *use_mmap,
- pa_bool_t *use_tsched,
- pa_bool_t require_exact_channel_number) {
+ bool *use_mmap,
+ bool *use_tsched,
+ bool require_exact_channel_number) {
snd_pcm_t *pcm_handle;
char **i;
@@ -862,18 +862,18 @@ void pa_alsa_refcnt_dec(void) {
}
}
-pa_bool_t pa_alsa_init_description(pa_proplist *p) {
+bool pa_alsa_init_description(pa_proplist *p) {
const char *d, *k;
pa_assert(p);
if (pa_device_init_description(p))
- return TRUE;
+ return true;
if (!(d = pa_proplist_gets(p, "alsa.card_name")))
d = pa_proplist_gets(p, "alsa.name");
if (!d)
- return FALSE;
+ return false;
k = pa_proplist_gets(p, PA_PROP_DEVICE_PROFILE_DESCRIPTION);
@@ -882,7 +882,7 @@ pa_bool_t pa_alsa_init_description(pa_proplist *p) {
else if (d)
pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, d);
- return FALSE;
+ return false;
}
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) {
@@ -1142,7 +1142,7 @@ snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa
}
int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss,
- pa_bool_t capture) {
+ bool capture) {
ssize_t k;
size_t abs_k;
int err;
@@ -1333,7 +1333,7 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_
64000, 88200, 96000,
128000, 176400, 192000,
384000 };
- pa_bool_t supported[PA_ELEMENTSOF(all_rates)] = { FALSE, };
+ bool supported[PA_ELEMENTSOF(all_rates)] = { false, };
snd_pcm_hw_params_t *hwparams;
unsigned int i, j, n, *rates = NULL;
int ret;
@@ -1347,7 +1347,7 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_
for (i = 0, n = 0; i < PA_ELEMENTSOF(all_rates); i++) {
if (snd_pcm_hw_params_test_rate(pcm, hwparams, all_rates[i], 0) == 0) {
- supported[i] = TRUE;
+ supported[i] = true;
n++;
}
}
@@ -1377,26 +1377,26 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_
return rates;
}
-pa_bool_t pa_alsa_pcm_is_hw(snd_pcm_t *pcm) {
+bool pa_alsa_pcm_is_hw(snd_pcm_t *pcm) {
snd_pcm_info_t* info;
snd_pcm_info_alloca(&info);
pa_assert(pcm);
if (snd_pcm_info(pcm, info) < 0)
- return FALSE;
+ return false;
return snd_pcm_info_get_card(info) >= 0;
}
-pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm) {
+bool pa_alsa_pcm_is_modem(snd_pcm_t *pcm) {
snd_pcm_info_t* info;
snd_pcm_info_alloca(&info);
pa_assert(pcm);
if (snd_pcm_info(pcm, info) < 0)
- return FALSE;
+ return false;
return snd_pcm_info_get_class(info) == SND_PCM_CLASS_MODEM;
}
@@ -1428,26 +1428,26 @@ const char* pa_alsa_strerror(int errnum) {
return translated;
}
-pa_bool_t pa_alsa_may_tsched(pa_bool_t want) {
+bool pa_alsa_may_tsched(bool want) {
if (!want)
- return FALSE;
+ return false;
if (!pa_rtclock_hrtimer()) {
/* We cannot depend on being woken up in time when the timers
are inaccurate, so let's fallback to classic IO based playback
then. */
pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel.");
- return FALSE; }
+ return false; }
if (pa_running_in_vm()) {
/* We cannot depend on being woken up when we ask for in a VM,
* so let's fallback to classic IO based playback then. */
pa_log_notice("Disabling timer-based scheduling because running inside a VM.");
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
snd_hctl_elem_t* pa_alsa_find_jack(snd_hctl_t *hctl, const char* jack_name) {