From 580a3d98729c4e47427107b42045ca65cf77534d Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sun, 12 Feb 2023 16:09:03 +0100 Subject: [PATCH] pw-cat: Enable libavutil logs This is useful for debugging pw-cat encoded audio playback errors. --- meson.build | 3 ++- src/tools/meson.build | 5 ++--- src/tools/pw-cat.c | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index e5f813ef7..5aff804f3 100644 --- a/meson.build +++ b/meson.build @@ -269,13 +269,14 @@ if not readline_dep.found() endif # Both the FFmpeg SPA plugin and the pw-cat FFmpeg integration use libavcodec. -# But only the latter also needs libavformat. +# But only the latter also needs libavformat and libavutil. # Search for these libraries here, globally, so both of these subprojects can reuse the results. pw_cat_ffmpeg = get_option('pw-cat-ffmpeg') ffmpeg = get_option('ffmpeg') if pw_cat_ffmpeg.allowed() or ffmpeg.allowed() avcodec_dep = dependency('libavcodec', required: pw_cat_ffmpeg.enabled() or ffmpeg.enabled()) avformat_dep = dependency('libavformat', required: pw_cat_ffmpeg.enabled()) + avutil_dep = dependency('libavutil', required: pw_cat_ffmpeg.enabled()) else avcodec_dep = dependency('', required: false) endif diff --git a/src/tools/meson.build b/src/tools/meson.build index 6623e7abc..d438a9643 100644 --- a/src/tools/meson.build +++ b/src/tools/meson.build @@ -38,9 +38,8 @@ pwcat_deps = [ sndfile_dep ] if get_option('pw-cat').allowed() and sndfile_dep.found() build_pw_cat = true - if pw_cat_ffmpeg.allowed() and avcodec_dep.found() and avformat_dep.found() - pwcat_deps += avcodec_dep - pwcat_deps += avformat_dep + if pw_cat_ffmpeg.allowed() and avcodec_dep.found() and avformat_dep.found() and avutil_dep.found() + pwcat_deps += [avcodec_dep, avformat_dep, avutil_dep] build_pw_cat_with_ffmpeg = true endif diff --git a/src/tools/pw-cat.c b/src/tools/pw-cat.c index 276172a9d..44ba746fe 100644 --- a/src/tools/pw-cat.c +++ b/src/tools/pw-cat.c @@ -35,6 +35,7 @@ #ifdef HAVE_PW_CAT_FFMPEG_INTEGRATION #include #include +#include #endif #include "midifile.h" @@ -1496,6 +1497,10 @@ int main(int argc, char *argv[]) setlocale(LC_ALL, ""); pw_init(&argc, &argv); +#ifdef HAVE_PW_CAT_FFMPEG_INTEGRATION + av_log_set_level(AV_LOG_DEBUG); +#endif + flags |= PW_STREAM_FLAG_AUTOCONNECT; prog = argv[0];