From 7ef15f372184ab58f27145becc5208059e36be60 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Dec 2020 17:54:40 +0100 Subject: [PATCH] pw-dump: convert unknown ids to id- --- src/tools/pw-dump.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tools/pw-dump.c b/src/tools/pw-dump.c index 6eebc78f0..f24530cf6 100644 --- a/src/tools/pw-dump.c +++ b/src/tools/pw-dump.c @@ -296,9 +296,18 @@ static void put_pod_value(struct data *d, const char *key, const struct spa_type put_value(d, NULL, *(int32_t*)body ? "true" : "false"); break; case SPA_TYPE_Id: - put_value(d, NULL, spa_debug_type_find_short_name(info, - *(int32_t*)body)); + { + const char *str; + char fallback[32]; + uint32_t id = *(uint32_t*)body; + str = spa_debug_type_find_short_name(info, *(uint32_t*)body); + if (str == NULL) { + snprintf(fallback, sizeof(fallback)-1, "id-%08x", id); + str = fallback; + } + put_value(d, NULL, str); break; + } case SPA_TYPE_Int: put_int(d, NULL, *(int32_t*)body); break;