This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 360fda56cd339854d39f136c667cb870bf840b9a Author: Martin Storsjö <[email protected]> AuthorDate: Mon Dec 1 16:22:07 2025 +0200 Commit: Martin Storsjö <[email protected]> CommitDate: Fri Dec 12 18:39:34 2025 +0200 avformat: Skip logging in ff_make_codec_str if logctx == NULL This is in preparation for reusing the same codepaths for a public API, where we don't want it to print various diagnostic logging. --- libavformat/codecstring.c | 6 ++++-- libavformat/vpcc.c | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libavformat/codecstring.c b/libavformat/codecstring.c index 12e0fd22c8..acd2ea3a4e 100644 --- a/libavformat/codecstring.c +++ b/libavformat/codecstring.c @@ -54,7 +54,8 @@ static void set_vp9_codec_str(void *logctx, const AVCodecParameters *par, vpcc.profile, vpcc.level, vpcc.bitdepth); } else { // Default to just vp9 in case of error while finding out profile or level - av_log(logctx, AV_LOG_WARNING, "Could not find VP9 profile and/or level\n"); + if (logctx) + av_log(logctx, AV_LOG_WARNING, "Could not find VP9 profile and/or level\n"); av_bprintf(out, "vp9"); } } @@ -194,7 +195,8 @@ int ff_make_codec_str(void *logctx, const AVCodecParameters *par, // RFC 6381 av_bprintf(out, "mp4v.20"); // Unimplemented, should output ProfileLevelIndication as a decimal number - av_log(logctx, AV_LOG_WARNING, "Incomplete RFC 6381 codec string for mp4v\n"); + if (logctx) + av_log(logctx, AV_LOG_WARNING, "Incomplete RFC 6381 codec string for mp4v\n"); } else if (par->codec_id == AV_CODEC_ID_MP2) { av_bprintf(out, "mp4a.40.33"); } else if (par->codec_id == AV_CODEC_ID_MP3) { diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c index 6601219e6a..d2989c55de 100644 --- a/libavformat/vpcc.c +++ b/libavformat/vpcc.c @@ -51,7 +51,8 @@ static int get_vpx_chroma_subsampling(void *logctx, return VPX_SUBSAMPLING_444; } } - av_log(logctx, AV_LOG_ERROR, "Unsupported pixel format (%d)\n", pixel_format); + if (logctx) + av_log(logctx, AV_LOG_ERROR, "Unsupported pixel format (%d)\n", pixel_format); return -1; } @@ -59,8 +60,9 @@ static int get_bit_depth(void *logctx, enum AVPixelFormat pixel_format) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pixel_format); if (desc == NULL) { - av_log(logctx, AV_LOG_ERROR, "Unsupported pixel format (%d)\n", - pixel_format); + if (logctx) + av_log(logctx, AV_LOG_ERROR, "Unsupported pixel format (%d)\n", + pixel_format); return -1; } return desc->comp[0].depth; @@ -187,7 +189,7 @@ int ff_isom_get_vpcc_features(void *logctx, const AVCodecParameters *par, } } - if (profile == AV_PROFILE_UNKNOWN || !bit_depth) + if ((profile == AV_PROFILE_UNKNOWN || !bit_depth) && logctx) av_log(logctx, AV_LOG_WARNING, "VP9 profile and/or bit depth not set or could not be derived\n"); vpcc->profile = profile; _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
