[vlc-devel] [PATCH] contrib: ffmpeg: Backport a patch to fix builds on android x86_64

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Oct 16 14:51:21 CEST 2019


---
 ...anf-do-not-use-long-double-functions.patch | 64 +++++++++++++++++++
 contrib/src/ffmpeg/rules.mak                  |  1 +
 2 files changed, 65 insertions(+)
 create mode 100644 contrib/src/ffmpeg/0001-avutil-avsscanf-do-not-use-long-double-functions.patch

diff --git a/contrib/src/ffmpeg/0001-avutil-avsscanf-do-not-use-long-double-functions.patch b/contrib/src/ffmpeg/0001-avutil-avsscanf-do-not-use-long-double-functions.patch
new file mode 100644
index 0000000000..e12fe2936b
--- /dev/null
+++ b/contrib/src/ffmpeg/0001-avutil-avsscanf-do-not-use-long-double-functions.patch
@@ -0,0 +1,64 @@
+From be60dc2145ba2c4e2c66213688b377367bdb9665 Mon Sep 17 00:00:00 2001
+From: Paul B Mahol <onemda at gmail.com>
+Date: Sat, 15 Dec 2018 09:58:28 +0100
+Subject: [PATCH] avutil/avsscanf: do not use long double functions
+
+Not needed when only double is used.
+---
+ libavutil/avsscanf.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/libavutil/avsscanf.c b/libavutil/avsscanf.c
+index 360170c9a9..1c85412fd4 100644
+--- a/libavutil/avsscanf.c
++++ b/libavutil/avsscanf.c
+@@ -454,8 +454,8 @@ static double decfloat(FFFILE *f, int c, int bits, int emin, int sign, int pok)
+ 
+     /* Calculate bias term to force rounding, move out lower bits */
+     if (bits < DBL_MANT_DIG) {
+-        bias = copysignl(scalbn(1, 2*DBL_MANT_DIG-bits-1), y);
+-        frac = fmodl(y, scalbn(1, DBL_MANT_DIG-bits));
++        bias = copysign(scalbn(1, 2*DBL_MANT_DIG-bits-1), y);
++        frac = fmod(y, scalbn(1, DBL_MANT_DIG-bits));
+         y -= frac;
+         y += bias;
+     }
+@@ -473,7 +473,7 @@ static double decfloat(FFFILE *f, int c, int bits, int emin, int sign, int pok)
+             else
+                 frac += 0.75*sign;
+         }
+-        if (DBL_MANT_DIG-bits >= 2 && !fmodl(frac, 1))
++        if (DBL_MANT_DIG-bits >= 2 && !fmod(frac, 1))
+             frac++;
+     }
+ 
+@@ -491,7 +491,7 @@ static double decfloat(FFFILE *f, int c, int bits, int emin, int sign, int pok)
+             errno = ERANGE;
+     }
+ 
+-    return scalbnl(y, e2);
++    return scalbn(y, e2);
+ }
+ 
+ static double hexfloat(FFFILE *f, int bits, int emin, int sign, int pok)
+@@ -595,7 +595,7 @@ static double hexfloat(FFFILE *f, int bits, int emin, int sign, int pok)
+     }
+ 
+     if (bits < DBL_MANT_DIG)
+-        bias = copysignl(scalbn(1, 32+DBL_MANT_DIG-bits-1), sign);
++        bias = copysign(scalbn(1, 32+DBL_MANT_DIG-bits-1), sign);
+ 
+     if (bits<32 && y && !(x&1)) x++, y=0;
+ 
+@@ -604,7 +604,7 @@ static double hexfloat(FFFILE *f, int bits, int emin, int sign, int pok)
+ 
+     if (!y) errno = ERANGE;
+ 
+-    return scalbnl(y, e2);
++    return scalbn(y, e2);
+ }
+ 
+ static double fffloatscan(FFFILE *f, int prec, int pok)
+-- 
+2.20.1
+
diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
index 8179fc3c93..cfafb64699 100644
--- a/contrib/src/ffmpeg/rules.mak
+++ b/contrib/src/ffmpeg/rules.mak
@@ -247,6 +247,7 @@ ifdef USE_FFMPEG
 	$(APPLY) $(SRC)/ffmpeg/ffmpeg-mkv-overshoot.patch
 	$(APPLY) $(SRC)/ffmpeg/0001-avcodec-hevcdec-set-the-SEI-parameters-early-on-the-.patch
 	$(APPLY) $(SRC)/ffmpeg/0001-avcodec-h264_slice-set-the-SEI-parameters-early-on-t.patch
+	$(APPLY) $(SRC)/ffmpeg/0001-avutil-avsscanf-do-not-use-long-double-functions.patch
 endif
 ifdef USE_LIBAV
 	$(APPLY) $(SRC)/ffmpeg/libav_gsm.patch
-- 
2.20.1



More information about the vlc-devel mailing list