Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/aom_film_grain: Cast const away to suppress compiler, warning
@ 2025-03-12 18:06 Andreas Rheinhardt
  2025-03-15  1:08 ` Andreas Rheinhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rheinhardt @ 2025-03-12 18:06 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 27 bytes --]

Patch attached.

- Andreas

[-- Attachment #2: 0001-avcodec-aom_film_grain-Cast-const-away-to-suppress-c.patch --]
[-- Type: text/x-patch, Size: 1440 bytes --]

From fa46d708680d10dd2f9b8eeee0365eafbeeda6cc Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 12 Mar 2025 18:59:05 +0100
Subject: [PATCH] avcodec/aom_film_grain: Cast const away to suppress compiler
 warning

av_frame_side_data_add() typically takes ownership of
the provided AVBufferRef reference and therefore
uses a parameter of type AVBufferRef**; yet with
the AV_FRAME_SIDE_DATA_FLAG_NEW_REF, it creates
new references instead, without touching the given
reference. Therefore it is safe to cast const away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/aom_film_grain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/aom_film_grain.c b/libavcodec/aom_film_grain.c
index d5ea75f61c..0f24a2bcf8 100644
--- a/libavcodec/aom_film_grain.c
+++ b/libavcodec/aom_film_grain.c
@@ -366,7 +366,8 @@ int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *fram
             continue;
 
         if (!av_frame_side_data_add(&frame->side_data, &frame->nb_side_data,
-                                    AV_FRAME_DATA_FILM_GRAIN_PARAMS, &s->sets[i],
+                                    AV_FRAME_DATA_FILM_GRAIN_PARAMS,
+                                    (AVBufferRef**)&s->sets[i],
                                     AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
             return AVERROR(ENOMEM);
     }
-- 
2.45.2


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/aom_film_grain: Cast const away to suppress compiler, warning
  2025-03-12 18:06 [FFmpeg-devel] [PATCH] avcodec/aom_film_grain: Cast const away to suppress compiler, warning Andreas Rheinhardt
@ 2025-03-15  1:08 ` Andreas Rheinhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Rheinhardt @ 2025-03-15  1:08 UTC (permalink / raw)
  To: ffmpeg-devel

Andreas Rheinhardt:
> Patch attached.
> 
> - Andreas
> 
Will apply.

- 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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-15  1:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-12 18:06 [FFmpeg-devel] [PATCH] avcodec/aom_film_grain: Cast const away to suppress compiler, warning Andreas Rheinhardt
2025-03-15  1:08 ` Andreas Rheinhardt

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