From 0a5cff62416573b6f899e6c969a7dad6b2f15161 Mon Sep 17 00:00:00 2001 From: Peter Meerwald-Stadler Date: Mon, 15 Aug 2016 19:08:49 +0200 Subject: [PATCH] sink-input,source-output: Fix logging, don't overwrite old_value when value == 0 --- src/pulsecore/sink-input.c | 10 ++++------ src/pulsecore/source-output.c | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 1ed5dda9f..435e63ebe 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 c70af7ae4..35ef1c540 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;