audioadapter: add some more debug info when parsing fails

This commit is contained in:
Wim Taymans 2025-10-23 18:05:22 +02:00
parent 5e1e3fca1e
commit be29ae4ef6

View file

@ -808,6 +808,7 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
if (spa_format_audio_parse(param, &info) < 0) { if (spa_format_audio_parse(param, &info) < 0) {
spa_log_error(this->log, "%p: cannot set Format param: " spa_log_error(this->log, "%p: cannot set Format param: "
"parsing the POD failed", this); "parsing the POD failed", this);
spa_debug_log_pod(this->log, SPA_LOG_LEVEL_ERROR, 0, NULL, param);
return -EINVAL; return -EINVAL;
} }
if (info.media_subtype != SPA_MEDIA_SUBTYPE_raw) { if (info.media_subtype != SPA_MEDIA_SUBTYPE_raw) {
@ -841,6 +842,7 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
SPA_PARAM_PORT_CONFIG_format, SPA_POD_OPT_Pod(&format)) < 0) { SPA_PARAM_PORT_CONFIG_format, SPA_POD_OPT_Pod(&format)) < 0) {
spa_log_error(this->log, "%p: cannot set PortConfig param: " spa_log_error(this->log, "%p: cannot set PortConfig param: "
"parsing the POD failed", this); "parsing the POD failed", this);
spa_debug_log_pod(this->log, SPA_LOG_LEVEL_ERROR, 0, NULL, param);
return -EINVAL; return -EINVAL;
} }
@ -848,8 +850,12 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
struct spa_audio_info info; struct spa_audio_info info;
spa_zero(info); spa_zero(info);
if ((res = spa_format_audio_parse(format, &info)) < 0) if ((res = spa_format_audio_parse(format, &info)) < 0) {
spa_log_error(this->log, "%p: cannot set PortConfig param: "
"parsing format failed: %s", this, spa_strerror(res));
spa_debug_log_pod(this->log, SPA_LOG_LEVEL_ERROR, 0, NULL, format);
return res; return res;
}
if (info.media_subtype == SPA_MEDIA_SUBTYPE_raw) { if (info.media_subtype == SPA_MEDIA_SUBTYPE_raw) {
info.info.raw.rate = 0; info.info.raw.rate = 0;