From: James Almer via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: James Almer <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avfilter/buffersink: add missing checks for alphamodes (PR #20469)
Date: Mon, 08 Sep 2025 18:10:11 -0000
Message-ID: <175735501247.25.7559213113986495289@463a07221176> (raw)
PR #20469 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20469
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20469.patch
>From b186d5443afc5eda3c478c61eb8a29fc3821a898 Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Mon, 8 Sep 2025 15:07:20 -0300
Subject: [PATCH 1/2] avfilter/buffersink: add missing checks for alphamodes
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavfilter/buffersink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index f636d3728f..c2d1efa78c 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -181,7 +181,7 @@ static av_cold int common_init(AVFilterContext *ctx)
if (ctx->input_pads[0].type == AVMEDIA_TYPE_VIDEO) {
if ((buf->pixel_fmts_size || buf->color_spaces_size || buf->color_ranges_size || buf->alpha_modes_size) &&
- (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges)) {
+ (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges || buf->nb_alphamodes)) {
av_log(ctx, AV_LOG_ERROR, "Cannot combine old and new format lists\n");
return AVERROR(EINVAL);
}
@@ -400,7 +400,7 @@ static int vsink_query_formats(const AVFilterContext *ctx,
int ret;
#if FF_API_BUFFERSINK_OPTS
- if (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges) {
+ if (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges || buf->nb_alphamodes) {
#endif
if (buf->nb_pixel_formats) {
ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, buf->pixel_formats);
--
2.49.1
>From 5e2876349253560a4a3207eda365523c2e4843b0 Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Mon, 8 Sep 2025 15:08:49 -0300
Subject: [PATCH 2/2] fftools/ffplay: set the alphamodes buffersink array
option instead of the binary one
And add the missing goto fail. This should ensure the alpha mode is set and remove
bogus warnings printed by ffplay.
Signed-off-by: James Almer <jamrial@gmail.com>
---
fftools/ffplay.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 05eadb69a6..dc2627521e 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -1938,9 +1938,10 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
AV_OPT_TYPE_INT, sdl_supported_color_spaces)) < 0)
goto fail;
- if ((ret = av_opt_set_array(filt_out, "alpha_modes", AV_OPT_SEARCH_CHILDREN,
+ if ((ret = av_opt_set_array(filt_out, "alphamodes", AV_OPT_SEARCH_CHILDREN,
0, FF_ARRAY_ELEMS(sdl_supported_alpha_modes),
AV_OPT_TYPE_INT, sdl_supported_alpha_modes)) < 0)
+ goto fail;
ret = avfilter_init_dict(filt_out, NULL);
if (ret < 0)
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2025-09-08 18:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=175735501247.25.7559213113986495289@463a07221176 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@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