[FFmpeg-devel] [PATCH] lavu/tx: stop using av_log(NULL, )

Anton Khirnov anton at khirnov.net
Sun May 28 20:00:59 EEST 2023


Quoting Lynne (2023-05-28 04:48:00)
> May 28, 2023, 03:07 by jamrial at gmail.com:
> 
> > On 5/24/2023 9:32 PM, Lynne wrote:
> >
> >> May 24, 2023, 23:24 by leo.izen at gmail.com:
> >>
> >>> On 5/24/23 16:35, Lynne wrote:
> >>>
> >>>> Patch attached.
> >>>>
> >>>
> >>> +    av_log((void *)&tx_class, AV_LOG_DEBUG, "%s\n", bp.str);
> >>>
> >>> The type of the first argument to av_log should be AVClass **, but this only appears to be AVClass *. See libavutil/log.c line 428.
> >>>
> >>> - Leo Izen
> >>>
> >>
> >> Right, thanks, changed to:
> >>
> >>> static const AVClass tx_class = {
> >>>       .class_name                = "tx",
> >>>       .item_name                 = av_default_item_name,
> >>>       .version                   = LIBAVUTIL_VERSION_INT,
> >>> };
> >>>
> >>> static const struct {
> >>>       const AVClass *tx_class;
> >>> } tx_log = {
> >>>       &tx_class,
> >>> };
> >>>
> >> Will push this tomorrow.
> >>
> >
> > Can't add an AVClass* field to AVTXContext and set it to &tx_class during init?
> >
> 
> The struct is accessed from asm, didn't really want to fix all the loads
> for something which only runs at init, and only if !CONFIG_SMALL.

That's largely missing the point of having a non-NULL logging context,
which is that the log callback has access to the context. It's private
in this case, but AVOptions could still be used to retrieve things like
per-context opaque.

There have also been discussions recently about a per-context logging
callback being highly useful for some cases.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list