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",
         OFFSET(flip), AV_OPT_TYPE_FLAGS,
         { .i64 = 0 }, 0, FLIP_HORIZONTAL | FLIP_VERTICAL, FLAGS, .unit = "flip" },
-- 
2.47.1.windows.2

