[pulseaudio-discuss] [PATCH 5/7] sink-input, source-output: remove set_name()

Tanu Kaskinen tanuk at iki.fi
Tue Mar 22 13:41:28 UTC 2016


pa_sink_input_set_property() does everything pa_sink_input_set_name()
does.
---
 src/pulsecore/protocol-native.c |  4 ++--
 src/pulsecore/sink-input.c      | 25 -------------------------
 src/pulsecore/sink-input.h      |  2 --
 src/pulsecore/source-output.c   | 25 -------------------------
 src/pulsecore/source-output.h   |  2 --
 5 files changed, 2 insertions(+), 56 deletions(-)

diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 145db04..4014c15 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -4447,7 +4447,7 @@ static void command_set_stream_name(pa_pdispatch *pd, uint32_t command, uint32_t
         CHECK_VALIDITY(c->pstream, s, tag, PA_ERR_NOENTITY);
         CHECK_VALIDITY(c->pstream, playback_stream_isinstance(s), tag, PA_ERR_NOENTITY);
 
-        pa_sink_input_set_name(s->sink_input, name);
+        pa_sink_input_set_property(s->sink_input, PA_PROP_MEDIA_NAME, name);
 
     } else {
         record_stream *s;
@@ -4456,7 +4456,7 @@ static void command_set_stream_name(pa_pdispatch *pd, uint32_t command, uint32_t
         s = pa_idxset_get_by_index(c->record_streams, idx);
         CHECK_VALIDITY(c->pstream, s, tag, PA_ERR_NOENTITY);
 
-        pa_source_output_set_name(s->source_output, name);
+        pa_source_output_set_property(s->source_output, PA_PROP_MEDIA_NAME, name);
     }
 
     pa_pstream_send_simple_ack(c->pstream, tag);
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 42d0b32..361b445 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1575,31 +1575,6 @@ int pa_sink_input_set_rate(pa_sink_input *i, uint32_t rate) {
 }
 
 /* Called from main context */
-void pa_sink_input_set_name(pa_sink_input *i, const char *name) {
-    const char *old;
-    pa_sink_input_assert_ref(i);
-    pa_assert_ctl_context();
-
-    if (!name && !pa_proplist_contains(i->proplist, PA_PROP_MEDIA_NAME))
-        return;
-
-    old = pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME);
-
-    if (old && name && pa_streq(old, name))
-        return;
-
-    if (name)
-        pa_proplist_sets(i->proplist, PA_PROP_MEDIA_NAME, name);
-    else
-        pa_proplist_unset(i->proplist, PA_PROP_MEDIA_NAME);
-
-    if (PA_SINK_INPUT_IS_LINKED(i->state)) {
-        pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED], i);
-        pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
-    }
-}
-
-/* Called from main context */
 pa_resample_method_t pa_sink_input_get_resample_method(pa_sink_input *i) {
     pa_sink_input_assert_ref(i);
     pa_assert_ctl_context();
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index 3485d6e..8bbee4e 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
@@ -335,8 +335,6 @@ int pa_sink_input_new(
 void pa_sink_input_put(pa_sink_input *i);
 void pa_sink_input_unlink(pa_sink_input* i);
 
-void pa_sink_input_set_name(pa_sink_input *i, const char *name);
-
 pa_usec_t pa_sink_input_set_requested_latency(pa_sink_input *i, pa_usec_t usec);
 
 /* Request that the specified number of bytes already written out to
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index f3910c5..d74a60e 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -1227,31 +1227,6 @@ int pa_source_output_set_rate(pa_source_output *o, uint32_t rate) {
 }
 
 /* Called from main context */
-void pa_source_output_set_name(pa_source_output *o, const char *name) {
-    const char *old;
-    pa_assert_ctl_context();
-    pa_source_output_assert_ref(o);
-
-    if (!name && !pa_proplist_contains(o->proplist, PA_PROP_MEDIA_NAME))
-        return;
-
-    old = pa_proplist_gets(o->proplist, PA_PROP_MEDIA_NAME);
-
-    if (old && name && pa_streq(old, name))
-        return;
-
-    if (name)
-        pa_proplist_sets(o->proplist, PA_PROP_MEDIA_NAME, name);
-    else
-        pa_proplist_unset(o->proplist, PA_PROP_MEDIA_NAME);
-
-    if (PA_SOURCE_OUTPUT_IS_LINKED(o->state)) {
-        pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PROPLIST_CHANGED], o);
-        pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
-    }
-}
-
-/* Called from main context */
 pa_resample_method_t pa_source_output_get_resample_method(pa_source_output *o) {
     pa_source_output_assert_ref(o);
     pa_assert_ctl_context();
diff --git a/src/pulsecore/source-output.h b/src/pulsecore/source-output.h
index b804092..7ac44bd 100644
--- a/src/pulsecore/source-output.h
+++ b/src/pulsecore/source-output.h
@@ -291,8 +291,6 @@ int pa_source_output_new(
 void pa_source_output_put(pa_source_output *o);
 void pa_source_output_unlink(pa_source_output*o);
 
-void pa_source_output_set_name(pa_source_output *o, const char *name);
-
 pa_usec_t pa_source_output_set_requested_latency(pa_source_output *o, pa_usec_t usec);
 
 void pa_source_output_cork(pa_source_output *o, bool b);
-- 
2.7.0



More information about the pulseaudio-discuss mailing list