mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-03-14 05:33:55 -04:00
alsa-sink/source: Rename a variable for supported sample rates in userdata
It is changed from 'rates' to 'supported_rates'. Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
This commit is contained in:
parent
bee9b9481a
commit
c4efbc81b0
2 changed files with 16 additions and 16 deletions
|
|
@ -112,7 +112,7 @@ struct userdata {
|
||||||
pa_cvolume hardware_volume;
|
pa_cvolume hardware_volume;
|
||||||
|
|
||||||
pa_sample_format_t *supported_formats;
|
pa_sample_format_t *supported_formats;
|
||||||
unsigned int *rates;
|
unsigned int *supported_rates;
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
frame_size,
|
frame_size,
|
||||||
|
|
@ -1647,14 +1647,14 @@ static bool sink_set_formats(pa_sink *s, pa_idxset *formats) {
|
||||||
* framework, but this must be changed if we do. */
|
* framework, but this must be changed if we do. */
|
||||||
|
|
||||||
/* Count how many sample rates we support */
|
/* Count how many sample rates we support */
|
||||||
for (idx = 0, n = 0; u->rates[idx]; idx++)
|
for (idx = 0, n = 0; u->supported_rates[idx]; idx++)
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
/* First insert non-PCM formats since we prefer those. */
|
/* First insert non-PCM formats since we prefer those. */
|
||||||
PA_IDXSET_FOREACH(f, formats, idx) {
|
PA_IDXSET_FOREACH(f, formats, idx) {
|
||||||
if (!pa_format_info_is_pcm(f)) {
|
if (!pa_format_info_is_pcm(f)) {
|
||||||
g = pa_format_info_copy(f);
|
g = pa_format_info_copy(f);
|
||||||
pa_format_info_set_prop_int_array(g, PA_PROP_FORMAT_RATE, (int *) u->rates, n);
|
pa_format_info_set_prop_int_array(g, PA_PROP_FORMAT_RATE, (int *) u->supported_rates, n);
|
||||||
pa_idxset_put(u->formats, g, NULL);
|
pa_idxset_put(u->formats, g, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1680,8 +1680,8 @@ static int sink_reconfigure_cb(pa_sink *s, pa_sample_spec *spec, bool passthroug
|
||||||
|
|
||||||
pa_assert(u);
|
pa_assert(u);
|
||||||
|
|
||||||
for (i = 0; u->rates[i]; i++) {
|
for (i = 0; u->supported_rates[i]; i++) {
|
||||||
if (u->rates[i] == spec->rate) {
|
if (u->supported_rates[i] == spec->rate) {
|
||||||
supported = true;
|
supported = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2356,8 +2356,8 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
u->rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
|
u->supported_rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
|
||||||
if (!u->rates) {
|
if (!u->supported_rates) {
|
||||||
pa_log_error("Failed to find any supported sample rates.");
|
pa_log_error("Failed to find any supported sample rates.");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
@ -2639,8 +2639,8 @@ static void userdata_free(struct userdata *u) {
|
||||||
if (u->supported_formats)
|
if (u->supported_formats)
|
||||||
pa_xfree(u->supported_formats);
|
pa_xfree(u->supported_formats);
|
||||||
|
|
||||||
if (u->rates)
|
if (u->supported_rates)
|
||||||
pa_xfree(u->rates);
|
pa_xfree(u->supported_rates);
|
||||||
|
|
||||||
reserve_done(u);
|
reserve_done(u);
|
||||||
monitor_done(u);
|
monitor_done(u);
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ struct userdata {
|
||||||
pa_cvolume hardware_volume;
|
pa_cvolume hardware_volume;
|
||||||
|
|
||||||
pa_sample_format_t *supported_formats;
|
pa_sample_format_t *supported_formats;
|
||||||
unsigned int *rates;
|
unsigned int *supported_rates;
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
frame_size,
|
frame_size,
|
||||||
|
|
@ -1476,8 +1476,8 @@ static int source_reconfigure_cb(pa_source *s, pa_sample_spec *spec, bool passth
|
||||||
|
|
||||||
pa_assert(u);
|
pa_assert(u);
|
||||||
|
|
||||||
for (i = 0; u->rates[i]; i++) {
|
for (i = 0; u->supported_rates[i]; i++) {
|
||||||
if (u->rates[i] == spec->rate) {
|
if (u->supported_rates[i] == spec->rate) {
|
||||||
supported = true;
|
supported = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2032,8 +2032,8 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
u->rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
|
u->supported_rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
|
||||||
if (!u->rates) {
|
if (!u->supported_rates) {
|
||||||
pa_log_error("Failed to find any supported sample rates.");
|
pa_log_error("Failed to find any supported sample rates.");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
@ -2269,8 +2269,8 @@ static void userdata_free(struct userdata *u) {
|
||||||
if (u->supported_formats)
|
if (u->supported_formats)
|
||||||
pa_xfree(u->supported_formats);
|
pa_xfree(u->supported_formats);
|
||||||
|
|
||||||
if (u->rates)
|
if (u->supported_rates)
|
||||||
pa_xfree(u->rates);
|
pa_xfree(u->supported_rates);
|
||||||
|
|
||||||
reserve_done(u);
|
reserve_done(u);
|
||||||
monitor_done(u);
|
monitor_done(u);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue