From: Michael Niedermayer via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Michael Niedermayer <michael@niedermayer.cc>
Subject: [FFmpeg-devel] Re: NAN compile error fix patch
Date: Sun, 7 Dec 2025 01:24:20 +0100
Message-ID: <aTTJNMUV20T3Gs2I@neo> (raw)
In-Reply-To: <BYAPR02MB399215BEF0F3D4ED0B32AD45C8D9A@BYAPR02MB3992.namprd02.prod.outlook.com>
[-- Attachment #1.1: Type: text/plain, Size: 2442 bytes --]
Hi
On Wed, Dec 03, 2025 at 09:31:58PM +0000, John Nelson via ffmpeg-devel wrote:
> This is a known issue apparently and been fixed in other places in the code in a similar way - however, there is a check for isnan() in the same file, so perhaps this won't work as well as the other cases.
>
> Thanks,
> John
> h264_metadata.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 2e8ff4b98142c5df9dad7aa72a6ed7cb7e8d4fb3 /var0001-remove-NAN-from-const-initializer-that-s-causing-com.patch
> From 03c0d37f6c8b0e8dc6f58ec50984c15f54dc6445 Mon Sep 17 00:00:00 2001
> From: John Nelson <jonelson@adobe.com>
> Date: Wed, 3 Dec 2025 13:27:57 -0800
> Subject: [PATCH] remove NAN from const initializer that's causing compile
> errors in some cases
>
> ---
> libavcodec/bsf/h264_metadata.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/bsf/h264_metadata.c b/libavcodec/bsf/h264_metadata.c
> index 477f1b18b6..91a5004b96 100644
> --- a/libavcodec/bsf/h264_metadata.c
> +++ b/libavcodec/bsf/h264_metadata.c
> @@ -590,6 +590,7 @@ static int h264_metadata_init(AVBSFContext *bsf)
> }
>
> #define OFFSET(x) offsetof(H264MetadataContext, x)
> +#define DEFAULT 0.0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
> #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
> static const AVOption h264_metadata_options[] = {
> BSF_ELEMENT_OPTIONS_PIR("aud", "Access Unit Delimiter NAL units",
> @@ -658,7 +659,7 @@ static const AVOption h264_metadata_options[] = {
>
> { "rotate", "Set rotation in display orientation SEI (anticlockwise angle in degrees)",
> OFFSET(rotate), AV_OPT_TYPE_DOUBLE,
> - { .dbl = NAN }, -360.0, +360.0, FLAGS },
> + { .dbl = DEFAULT }, -360.0, +360.0, FLAGS },
> { "flip", "Set flip in display orientation SEI",
how does this fail to build ?
try to include float.h and math.h
also if this originates from libavutil/mathematics.h, that define NAN
there should be fixed to comply to the standard
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The day soldiers stop bringing you their problems is the day you have stopped
leading them. They have either lost confidence that you can help or concluded
you do not care. Either case is a failure of leadership. - Colin Powell
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 163 bytes --]
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
prev parent reply other threads:[~2025-12-07 0:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-03 21:31 [FFmpeg-devel] " John Nelson via ffmpeg-devel
2025-12-07 0:24 ` Michael Niedermayer via ffmpeg-devel [this message]
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=aTTJNMUV20T3Gs2I@neo \
--to=ffmpeg-devel@ffmpeg.org \
--cc=michael@niedermayer.cc \
/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