From f0cfe9449d4bb963745b92f132dcdade8a07b510 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 26 Aug 2025 10:59:11 +0200 Subject: [PATCH] tools: dump sndfile loginfo on error when verbose --- src/tools/pw-cat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tools/pw-cat.c b/src/tools/pw-cat.c index 928afed0e..9be884fe6 100644 --- a/src/tools/pw-cat.c +++ b/src/tools/pw-cat.c @@ -1485,6 +1485,11 @@ static int setup_sndfile(struct data *data) if (!data->file) { fprintf(stderr, "sndfile: failed to open audio file \"%s\": %s\n", data->filename, sf_strerror(NULL)); + if (data->verbose) { + char loginfo[4096]; + if (sf_command(NULL, SFC_GET_LOG_INFO, &loginfo, sizeof(loginfo)) > 0) + fprintf(stderr, "%s\n", loginfo); + } return -EIO; }