Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] NAN compile error fix patch
@ 2025-12-03 21:31 John Nelson via ffmpeg-devel
  2025-12-07  0:24 ` [FFmpeg-devel] " Michael Niedermayer via ffmpeg-devel
  0 siblings, 1 reply; 2+ messages in thread
From: John Nelson via ffmpeg-devel @ 2025-12-03 21:31 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: John Nelson

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

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

[-- Attachment #2: 0001-remove-NAN-from-const-initializer-that-s-causing-com.patch --]
[-- Type: application/octet-stream, Size: 1468 bytes --]

[-- Attachment #3: 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

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

* [FFmpeg-devel] Re: NAN compile error fix patch
  2025-12-03 21:31 [FFmpeg-devel] NAN compile error fix patch John Nelson via ffmpeg-devel
@ 2025-12-07  0:24 ` Michael Niedermayer via ffmpeg-devel
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Niedermayer via ffmpeg-devel @ 2025-12-07  0:24 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Michael Niedermayer


[-- 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

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

end of thread, other threads:[~2025-12-07  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-03 21:31 [FFmpeg-devel] NAN compile error fix patch John Nelson via ffmpeg-devel
2025-12-07  0:24 ` [FFmpeg-devel] " Michael Niedermayer via ffmpeg-devel

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