alsa-mixer/card: Move to use the new mixer interface

Use the new mixer API to get callbacks, instead of using the hctl
API. Using the hctl API caused a memory leak, because alsa-lib itself
used the hctl callbacks, which we were previously overriding.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2014-09-01 15:41:39 +02:00
parent 1fd8848e64
commit f2120fc2b6
3 changed files with 25 additions and 25 deletions

View file

@ -1725,12 +1725,11 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) {
return 0;
}
static int jack_probe(pa_alsa_jack *j, snd_hctl_t *h) {
pa_assert(h);
static int jack_probe(pa_alsa_jack *j, snd_mixer_t *m) {
pa_assert(j);
pa_assert(j->path);
j->has_control = pa_alsa_find_jack(h, j->alsa_name) != NULL;
j->has_control = pa_alsa_mixer_find(m, j->alsa_name, 0) != NULL;
if (j->has_control) {
if (j->required_absent != PA_ALSA_REQUIRED_IGNORE)
@ -2678,7 +2677,7 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, bool i
pa_log_debug("Probing path '%s'", p->name);
PA_LLIST_FOREACH(j, p->jacks) {
if (jack_probe(j, hctl) < 0) {
if (jack_probe(j, m) < 0) {
p->supported = false;
pa_log_debug("Probe of jack '%s' failed.", j->alsa_name);
return -1;