From 89eb7f4f345e0f0f63bf714c6d1ae0256b79f7f2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 22 May 2024 15:06:31 +0200 Subject: [PATCH] vdec/lavd: print low-delay hint if applicable If not set, offer the disable even though there isn't any other hint. On contrary, if already set (disabled), do not offer the setting. --- src/video_decompress/libavcodec.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/video_decompress/libavcodec.c b/src/video_decompress/libavcodec.c index 25836ce43..0de208091 100644 --- a/src/video_decompress/libavcodec.c +++ b/src/video_decompress/libavcodec.c @@ -931,9 +931,15 @@ static void check_duration(struct state_libavcodec_decompress *s, double duratio hint = "\"--param lavd-thread-count=\" option with small or 0 (nr of logical cores)"; } if (hint) { - log_msg(LOG_LEVEL_WARNING, MOD_NAME "Consider adding %s to increase throughput at the expense of latency.\n" - "You may also try to disable low delay decode using 'd' flag.\n", - hint); + MSG(WARNING, + "Consider adding %s to increase throughput at the expense " + "of latency.\n", + hint); + } + if ((s->codec_ctx->flags & AV_CODEC_FLAG_LOW_DELAY) != 0) { + MSG(WARNING, + "Consider %sdisabling low delay decode using 'd' flag.\n", + hint != NULL ? "also " : ""); } bool in_rgb = av_pix_fmt_desc_get(s->convert_in)->flags & AV_PIX_FMT_FLAG_RGB;