summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Meerwald-Stadler <pmeerw@pmeerw.net>2016-08-15 19:08:49 +0200
committerPeter Meerwald-Stadler <pmeerw@pmeerw.net>2016-08-15 19:08:49 +0200
commit0a5cff62416573b6f899e6c969a7dad6b2f15161 (patch)
tree789cc47e54645370df351831b1d3e26c58dfce5b
parent1df21e6ab6cd42e2f7601a6c5577c20b7e3d1046 (diff)
sink-input,source-output: Fix logging, don't overwrite old_value when value == 0
-rw-r--r--src/pulsecore/sink-input.c10
-rw-r--r--src/pulsecore/source-output.c10
2 files changed, 8 insertions, 12 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 1ed5dda9..435e63eb 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1433,13 +1433,11 @@ void pa_sink_input_set_property(pa_sink_input *i, const char *key, const char *v
if (pa_proplist_contains(i->proplist, key)) {
old_value = pa_xstrdup(pa_proplist_gets(i->proplist, key));
- if (value && old_value) {
- if (pa_streq(value, old_value))
- goto finish;
- } else {
- pa_xfree(old_value);
+ if (value && old_value && pa_streq(value, old_value))
+ goto finish;
+
+ if (!old_value)
old_value = pa_xstrdup("(data)");
- }
} else {
if (!value)
goto finish;
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index c70af7ae..35ef1c54 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -1086,13 +1086,11 @@ void pa_source_output_set_property(pa_source_output *o, const char *key, const c
if (pa_proplist_contains(o->proplist, key)) {
old_value = pa_xstrdup(pa_proplist_gets(o->proplist, key));
- if (value && old_value) {
- if (pa_streq(value, old_value))
- goto finish;
- } else {
- pa_xfree(old_value);
+ if (value && old_value && pa_streq(value, old_value))
+ goto finish;
+
+ if (!old_value)
old_value = pa_xstrdup("(data)");
- }
} else {
if (!value)
goto finish;