pipewire/0022-pw-cli-always-output-to-stdout.patch

60 lines
1.9 KiB
Diff
Raw Normal View History

From 91875c1fd8ece6b1b94130c50304b715654f8681 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Fri, 19 Feb 2021 16:42:21 +0100
Subject: [PATCH 22/30] pw-cli: always output to stdout
Use spa_debug_pod because spa_debug_format outputs to stderr
---
src/tools/pw-cli.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/tools/pw-cli.c b/src/tools/pw-cli.c
index b682bf34e..7706a15fa 100644
--- a/src/tools/pw-cli.c
+++ b/src/tools/pw-cli.c
@@ -33,9 +33,10 @@
#endif
#include <getopt.h>
+#define spa_debug(...) fprintf(stdout,__VA_ARGS__);fputc('\n', stdout)
+
#include <spa/utils/result.h>
#include <spa/debug/pod.h>
-#include <spa/debug/format.h>
#include <spa/utils/keys.h>
#include <spa/utils/json.h>
#include <spa/pod/builder.h>
@@ -681,7 +682,7 @@ static void info_link(struct proxy_data *pd)
printf("\n");
fprintf(stdout, "%c\tformat:\n", MARK_CHANGE(PW_LINK_CHANGE_MASK_FORMAT));
if (info->format)
- spa_debug_format(2, NULL, info->format);
+ spa_debug_pod(2, NULL, info->format);
else
fprintf(stdout, "\t\tnone\n");
print_properties(info->props, MARK_CHANGE(PW_LINK_CHANGE_MASK_PROPS), true);
@@ -815,10 +816,7 @@ static void event_param(void *object, int seq, uint32_t id,
fprintf(stdout, "remote %d object %d param %d index %d\n",
rd->id, data->global->id, id, index);
- if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format))
- spa_debug_format(2, NULL, param);
- else
- spa_debug_pod(2, NULL, param);
+ spa_debug_pod(2, NULL, param);
}
static const struct pw_node_events node_events = {
@@ -2567,7 +2565,7 @@ dump_link(struct data *data, struct global *global,
printf("\n");
fprintf(stdout, "%sformat:\n", ind);
if (info->format)
- spa_debug_format(8 * (level + 1) + 2, NULL, info->format);
+ spa_debug_pod(8 * (level + 1) + 2, NULL, info->format);
else
fprintf(stdout, "%s\tnone\n", ind);
--
2.26.2