Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Lynne <dev@lynne.ee>
Subject: Re: [FFmpeg-devel] [PATCH] lavu/tx: stop using av_log(NULL, )
Date: Fri, 26 Jul 2024 10:43:39 +0200
Message-ID: <172198341982.21344.10503309806713123166@lain.khirnov.net> (raw)
In-Reply-To: <0656152d-6c99-4d3e-ac0f-6dc28faaa953@lynne.ee>

Quoting Lynne via ffmpeg-devel (2024-07-26 10:33:24)
> On 26/07/2024 09:47, Anton Khirnov wrote:
> > Quoting Lynne via ffmpeg-devel (2024-07-26 08:42:11)
> >> Its not feasible to add an AVClass in the main context, as
> >> it would waste space, as the main context is recursive, and
> >> every bit of assembly would need to be changed.
> >>
> >> While its true that on paper av_log has access to the main
> >> context, that functionality is not used as no options are
> >> available for setting. No options will be exposed either,
> >> and it makes no sense.
> >>
> >> mpv has recently started warning if a NULL AVClass is used
> >> as an FFmpeg bug. While I don't fully agree nor disagree with
> >> this, this is a simple patch which fixes the issue.
> > 
> > No, it just hides the issue for the time being.
> 
> If this means "it may get broken eventually, its not forbidden 
> anywhere", then IMO we should just codify the current behavior such that 
> it won't, unless there's some use-case you can think of.

It means "you're offloading fixing this issue properly on someone else",
which is a bad thing in my book. In my understanding of the API, it _is_
forbidden and UB.

> > I am against this patch, just add a proper AVClass. AVTXContext is
> > entirely opaque, so it should definitely be feasible.
> I'd like to avoid adding a pointer and allocating it if it can't be 
> helped. And properly integrating each context into the AVClass system as 
> a child of the parent context.

Consider the possibility that if your code depends on fixed layout of a
big and complex struct, then your code is...suboptimal. If it's about
offsets for SIMD, you could either
* generate them at build time
* move the things used by SIMD into a smaller struct embedded in the
  main context

> If you think a NULL av_log is valid (you implied that a year ago), then 
> I'm more than happy to drop this patch.

I didn't and I don't. To the contrary, I consider av_log(NULL) a
mispattern that we should be rid of.

-- 
Anton Khirnov
_______________________________________________
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".

  reply	other threads:[~2024-07-26  8:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26  6:42 Lynne via ffmpeg-devel
2024-07-26  7:47 ` Anton Khirnov
2024-07-26  8:33   ` Lynne via ffmpeg-devel
2024-07-26  8:43     ` Anton Khirnov [this message]
2024-07-26  8:22 ` Andreas Rheinhardt
2024-07-26  8:30   ` Lynne via ffmpeg-devel
2024-07-26  9:03     ` Andreas Rheinhardt
2024-07-26 11:42       ` Lynne via ffmpeg-devel
2024-07-26  8:37 ` Zhao Zhili
  -- strict thread matches above, loose matches on Subject: below --
2023-05-24 20:35 Lynne
2023-05-24 20:44 ` Paul B Mahol
2023-05-24 21:24 ` Leo Izen
2023-05-25  0:32   ` Lynne
2023-05-28  1:07     ` James Almer
2023-05-28  2:48       ` Lynne
2023-05-28 17:00         ` 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=172198341982.21344.10503309806713123166@lain.khirnov.net \
    --to=anton@khirnov.net \
    --cc=dev@lynne.ee \
    --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