From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v2 1/3] libavformat/oggdec: Allow first parameter in ff_vorbis_comment to be a generic AVClass struct
Date: Fri, 7 Feb 2025 12:56:16 +0100
Message-ID: <AS8P250MB074429C2FE85F989254549488FF12@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20250204111521.48785-2-romain.beauxis@gmail.com>
Romain Beauxis:
> Firt argument in these function is only used to pass to av_log. This
> makes it possible to re-use them with any type of AVClass struct.
>
> ---
> libavformat/oggdec.h | 5 ++++-
> libavformat/oggparsevorbis.c | 4 ++--
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
> index 43df23f4cb..6177254fd2 100644
> --- a/libavformat/oggdec.h
> +++ b/libavformat/oggdec.h
> @@ -136,8 +136,11 @@ extern const struct ogg_codec ff_vp8_codec;
> * so it needs to be writable. Furthermore it must be padded
> * by a single byte (not counted in size).
> * All changes will have been reverted upon return.
> + *
> + * @param avcl A pointer to an arbitrary struct of which the first field is a
> + * pointer to an AVClass struct.
> */
> -int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m,
> +int ff_vorbis_comment(void *avcl, AVDictionary **m,
> const uint8_t *buf, int size, int parse_picture);
>
> /**
> diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
> index 9f50ab9ffc..62eb8bbf70 100644
> --- a/libavformat/oggparsevorbis.c
> +++ b/libavformat/oggparsevorbis.c
> @@ -88,7 +88,7 @@ int ff_vorbis_stream_comment(AVFormatContext *as, AVStream *st,
> * and reverts its changes before return. The input buffer needs to have
> * at least one byte of padding.
> */
> -static int vorbis_parse_single_comment(AVFormatContext *as, AVDictionary **m,
> +static int vorbis_parse_single_comment(void *as, AVDictionary **m,
> const uint8_t *buf, uint32_t size,
> int *updates, int parse_picture)
> {
> @@ -146,7 +146,7 @@ end:
> return 0;
> }
>
> -int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
> +int ff_vorbis_comment(void *as, AVDictionary **m,
> const uint8_t *buf, int size,
> int parse_picture)
> {
This is wrong: ff_vorbis_comment() really requires an AVFormatContext*
(see e.g. ogm_chapter() or ff_flac_parse_picture()).
Anyway: Your comment could simply say "a logcontext". And the variable
could be renamed to logctx.
- Andreas
_______________________________________________
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:[~2025-02-07 11:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 11:15 [FFmpeg-devel] [PATCH v2 0/3] Properly decode ogg metadata in ogg/flac chained bitstreams Romain Beauxis
2025-02-04 11:15 ` [FFmpeg-devel] [PATCH v2 1/3] libavformat/oggdec: Allow first parameter in ff_vorbis_comment to be a generic AVClass struct Romain Beauxis
2025-02-07 11:56 ` Andreas Rheinhardt [this message]
2025-02-04 11:15 ` [FFmpeg-devel] [PATCH v2 2/3] libavcodec/flacdec: parse vorbis metadata from ogg packets, add them to the next decoded frame Romain Beauxis
2025-02-04 11:15 ` [FFmpeg-devel] [PATCH v2 3/3] Add stream dump test with test for ogg/flac Romain Beauxis
2025-02-04 12:19 ` [FFmpeg-devel] [PATCH v2 0/3] Properly decode ogg metadata in ogg/flac chained bitstreams Romain Beauxis
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=AS8P250MB074429C2FE85F989254549488FF12@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--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