[pulseaudio-discuss] [PATCH 7/7] card: simplify setting pa_card.name

Tanu Kaskinen tanuk at iki.fi
Fri Oct 23 03:56:46 PDT 2015


---
 src/pulsecore/card.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index f743e2a..fd0bf65 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -119,7 +119,6 @@ void pa_card_new_data_done(pa_card_new_data *data) {
 
 pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
     pa_card *c;
-    const char *name;
     void *state;
     pa_card_profile *profile;
     pa_device_port *port;
@@ -133,15 +132,12 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
     c = pa_xnew0(pa_card, 1);
     c->state = PA_CARD_STATE_INIT;
 
-    if (!(name = pa_namereg_register(core, data->name, PA_NAMEREG_CARD, c, data->namereg_fail))) {
+    if (!(c->name = pa_xstrdup(pa_namereg_register(core, data->name, PA_NAMEREG_CARD, c, data->namereg_fail)))) {
         pa_xfree(c);
         return NULL;
     }
 
-    pa_card_new_data_set_name(data, name);
-
     c->core = core;
-    c->name = pa_xstrdup(data->name);
     c->proplist = pa_proplist_copy(data->proplist);
     c->driver = pa_xstrdup(pa_path_get_filename(data->driver));
     c->module = data->module;
-- 
2.6.1



More information about the pulseaudio-discuss mailing list