X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/34dd4a20f2e976b260e8aa3f3128e55ec80bb85b..6031546f6660e06e05d0b40a4dbc0c8769eb10a6:/src/modules/module-zeroconf-discover.c diff --git a/src/modules/module-zeroconf-discover.c b/src/modules/module-zeroconf-discover.c index a4fbf020..b17f6e5c 100644 --- a/src/modules/module-zeroconf-discover.c +++ b/src/modules/module-zeroconf-discover.c @@ -5,7 +5,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but @@ -36,14 +36,9 @@ #include #include -#include -#include -#include -#include #include #include -#include #include #include #include @@ -162,23 +157,23 @@ static void resolver_cb( pa_module *m; ss = u->core->default_sample_spec; - pa_channel_map_init_extend(&cm, ss.channels, PA_CHANNEL_MAP_DEFAULT); + cm = u->core->default_channel_map; for (l = txt; l; l = l->next) { char *key, *value; pa_assert_se(avahi_string_list_get_pair(l, &key, &value, NULL) == 0); - if (strcmp(key, "device") == 0) { + if (pa_streq(key, "device")) { pa_xfree(device); device = value; value = NULL; - } else if (strcmp(key, "rate") == 0) - ss.rate = atoi(value); - else if (strcmp(key, "channels") == 0) - ss.channels = atoi(value); - else if (strcmp(key, "format") == 0) + } else if (pa_streq(key, "rate")) + ss.rate = (uint32_t) atoi(value); + else if (pa_streq(key, "channels")) + ss.channels = (uint8_t) atoi(value); + else if (pa_streq(key, "format")) ss.format = pa_parse_sample_format(value); - else if (strcmp(key, "channel_map") == 0) { + else if (pa_streq(key, "channel_map")) { pa_channel_map_parse(&cm, value); channel_map_set = TRUE; } @@ -279,14 +274,14 @@ static void browser_cb( pa_log("avahi_service_resolver_new() failed: %s", avahi_strerror(avahi_client_errno(u->client))); /* We ignore the returned resolver object here, since the we don't - * need to attach any special data to it, and we can still destory + * need to attach any special data to it, and we can still destroy * it from the callback */ } else if (event == AVAHI_BROWSER_REMOVE) { struct tunnel *t2; if ((t2 = pa_hashmap_get(u->tunnels, t))) { - pa_module_unload_by_index(u->core, t2->module_index, TRUE); + pa_module_unload_request_by_index(u->core, t2->module_index, TRUE); pa_hashmap_remove(u->tunnels, t2); tunnel_free(t2); } @@ -427,7 +422,7 @@ void pa__done(pa_module*m) { struct tunnel *t; while ((t = pa_hashmap_steal_first(u->tunnels))) { - pa_module_unload_by_index(u->core, t->module_index, TRUE); + pa_module_unload_request_by_index(u->core, t->module_index, TRUE); tunnel_free(t); }