]> code.delx.au - pulseaudio/commitdiff
format: Make pa_format_info_snprint() more parseable
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Fri, 12 Aug 2011 15:34:38 +0000 (21:04 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 15 Aug 2011 06:21:35 +0000 (11:51 +0530)
Removes the comma as the proplist separator since that makes
pa_proplist_from_string() break and prints only the encoding if there
are no properties (instead of "<encoding>, (no properties)").

src/pulse/format.c

index 81c329ff09f59d33a4c14a9f761118d27a9f3503..112b103c802c22c28368daf36de02b1cb5790365 100644 (file)
@@ -114,8 +114,11 @@ char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f) {
     if (!pa_format_info_valid(f))
         pa_snprintf(s, l, _("(invalid)"));
     else {
-        tmp = pa_proplist_to_string_sep(f->plist, ", ");
-        pa_snprintf(s, l, _("%s, %s"), pa_encoding_to_string(f->encoding), tmp[0] ? tmp : _("(no properties)"));
+        tmp = pa_proplist_to_string_sep(f->plist, "  ");
+        if (tmp[0])
+            pa_snprintf(s, l, "%s, %s", pa_encoding_to_string(f->encoding), tmp);
+        else
+            pa_snprintf(s, l, "%s", pa_encoding_to_string(f->encoding));
         pa_xfree(tmp);
     }