From: Anton Khirnov <anton@khirnov.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 4/4] lavu/log: do not assume AVClass.item_name is always set Date: Tue, 7 Nov 2023 13:58:35 +0100 Message-ID: <20231107125835.25827-4-anton@khirnov.net> (raw) In-Reply-To: <20231107125835.25827-1-anton@khirnov.net> --- libavutil/log.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavutil/log.c b/libavutil/log.c index 2d358b7ab9..46662f3db0 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -291,6 +291,11 @@ static const char *get_level_str(int level) } } +static const char *item_name(void *obj, const AVClass *cls) +{ + return (cls->item_name ? cls->item_name : av_default_item_name)(obj); +} + static void format_line(void *avcl, int level, const char *fmt, va_list vl, AVBPrint part[4], int *print_prefix, int type[2]) { @@ -307,12 +312,12 @@ static void format_line(void *avcl, int level, const char *fmt, va_list vl, avc->parent_log_context_offset); if (parent && *parent) { av_bprintf(part+0, "[%s @ %p] ", - (*parent)->item_name(parent), parent); + item_name(parent, *parent), parent); if(type) type[0] = get_category(parent); } } av_bprintf(part+1, "[%s @ %p] ", - avc->item_name(avcl), avcl); + item_name(avcl, avc), avcl); if(type) type[1] = get_category(avcl); } -- 2.42.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-11-07 12:59 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-07 12:58 [FFmpeg-devel] [PATCH 1/4] fftools/cmdutils: only set array size after allocation succeeded Anton Khirnov 2023-11-07 12:58 ` [FFmpeg-devel] [PATCH 2/4] fftools/ffmpeg_filter: fail on ifilter_alloc() failure Anton Khirnov 2023-11-07 12:58 ` [FFmpeg-devel] [PATCH 3/4] fftools/ffmpeg_filter: return an error on ofilter_alloc() failure Anton Khirnov 2023-11-07 12:58 ` Anton Khirnov [this message] 2023-11-07 20:52 ` [FFmpeg-devel] [PATCH 4/4] lavu/log: do not assume AVClass.item_name is always set James Almer 2023-11-09 10:25 ` Anton Khirnov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20231107125835.25827-4-anton@khirnov.net \ --to=anton@khirnov.net \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git