From 9c02a1df1783b9f8e28da65ce2a264b1f62d4aeb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 30 Jan 2024 12:19:13 +0100 Subject: [PATCH] alsa: use debug types instead of custom function --- spa/plugins/alsa/alsa-compress-offload-sink.c | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/spa/plugins/alsa/alsa-compress-offload-sink.c b/spa/plugins/alsa/alsa-compress-offload-sink.c index 3fbbf21d5..415e387a1 100644 --- a/spa/plugins/alsa/alsa-compress-offload-sink.c +++ b/spa/plugins/alsa/alsa-compress-offload-sink.c @@ -227,7 +227,6 @@ static inline bool is_following(struct impl *this); static int do_start(struct impl *this); static void do_stop(struct impl *this); static int write_queued_output_buffers(struct impl *this); -static const char * spa_command_to_string(const struct spa_command *command); /* Node and port functions */ @@ -1051,26 +1050,6 @@ again: } -static const char * spa_command_to_string(const struct spa_command *command) -{ - switch (SPA_NODE_COMMAND_ID(command)) { - case SPA_NODE_COMMAND_Suspend: return "Suspend"; - case SPA_NODE_COMMAND_Pause: return "Pause"; - case SPA_NODE_COMMAND_Start: return "Start"; - case SPA_NODE_COMMAND_Enable: return "Enable"; - case SPA_NODE_COMMAND_Disable: return "Disable"; - case SPA_NODE_COMMAND_Flush: return "Flush"; - case SPA_NODE_COMMAND_Drain: return "Drain"; - case SPA_NODE_COMMAND_Marker: return "Marker"; - case SPA_NODE_COMMAND_ParamBegin: return "ParamBegin"; - case SPA_NODE_COMMAND_ParamEnd: return "ParamEnd"; - case SPA_NODE_COMMAND_RequestProcess: return "RequestProcess"; - default: return ""; - } -} - - - /* Node and port functions */ static const struct spa_dict_item node_info_items[] = { @@ -1341,7 +1320,8 @@ static int impl_node_send_command(void *object, const struct spa_command *comman spa_return_val_if_fail(this != NULL, -EINVAL); spa_return_val_if_fail(command != NULL, -EINVAL); - spa_log_debug(this->log, "%p: got new command: %s", this, spa_command_to_string(command)); + spa_log_debug(this->log, "%p: got new command: %s", this, + spa_debug_type_find_name(spa_type_node_command_id, SPA_NODE_COMMAND_ID(command))); switch (SPA_NODE_COMMAND_ID(command)) { case SPA_NODE_COMMAND_ParamBegin: