musepack_tools, revbump, fixes crash on launch (#10685)

This commit is contained in:
Schrijvers Luc
2024-07-12 18:41:37 +02:00
committed by GitHub
parent a5be3e21b5
commit 48ef63e983
3 changed files with 87 additions and 23 deletions

View File

@@ -7,12 +7,11 @@ HOMEPAGE="https://www.musepack.net/"
COPYRIGHT="1997-2011 Andree Buschmann, Frank Klemm"
LICENSE="BSD (3-clause)
GNU LGPL v2.1"
REVISION="4"
REVISION="5"
SOURCE_URI="http://files.musepack.net/source/musepack_src_r$portVersion.tar.gz"
CHECKSUM_SHA256="a4b1742f997f83e1056142d556a8c20845ba764b70365ff9ccf2e3f81c427b2b"
SOURCE_DIR="musepack_src_r$portVersion"
PATCHES="musepack_tools-$portVersion.patchset
musepack-tools-465-fno-common.patch" # from Gentoo
PATCHES="musepack_tools-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

View File

@@ -1,16 +0,0 @@
https://bugs.gentoo.org/706992
--- a/libmpcdec/requant.h
+++ b/libmpcdec/requant.h
@@ -47,9 +47,9 @@
/* C O N S T A N T S */
-const mpc_uint8_t Res_bit [18]; ///< Bits per sample for chosen quantizer
-const MPC_SAMPLE_FORMAT __Cc [1 + 18]; ///< Requantization coefficients
-const mpc_int16_t __Dc [1 + 18]; ///< Requantization offset
+extern const mpc_uint8_t Res_bit [18]; ///< Bits per sample for chosen quantizer
+extern const MPC_SAMPLE_FORMAT __Cc [1 + 18]; ///< Requantization coefficients
+extern const mpc_int16_t __Dc [1 + 18]; ///< Requantization offset
#define Cc (__Cc + 1)
#define Dc (__Dc + 1)

View File

@@ -1,4 +1,4 @@
From 016aabd6f6d1a745a16518c58f38b8a48abb4407 Mon Sep 17 00:00:00 2001
From 7a4df1a5ad033e8c6cd500689473aaf74873076f Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 13 Sep 2014 17:52:12 +0200
Subject: Haiku and gcc2 fixes.
@@ -152,10 +152,10 @@ index 702a352..f4b61b6 100755
sample_buff[0][i] -= sample_buff[1][i];
if (sample_buff[0][i]) {
--
2.37.3
2.45.2
From a37cb1f9a8ce0ef222c316fb2b820ac274d98c4e Mon Sep 17 00:00:00 2001
From 3f6e6454df8448ab1dd8009e4d21043d0beca1dc Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Mon, 3 Apr 2023 15:56:54 +0200
Subject: Fix installation paths
@@ -185,5 +185,86 @@ index 0bc5b62..eaed254
endif(SHARED)
--
2.37.3
2.45.2
From 9839538b9c449351a12c4105e1ba941216a3cbc8 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Fri, 12 Jul 2024 18:33:55 +0200
Subject: applying patch musepack-tools-465-fno-common.patch
diff --git a/libmpcdec/requant.h b/libmpcdec/requant.h
index eb3124d..c95101f 100755
--- a/libmpcdec/requant.h
+++ b/libmpcdec/requant.h
@@ -47,9 +47,9 @@ extern "C" {
/* C O N S T A N T S */
-const mpc_uint8_t Res_bit [18]; ///< Bits per sample for chosen quantizer
-const MPC_SAMPLE_FORMAT __Cc [1 + 18]; ///< Requantization coefficients
-const mpc_int16_t __Dc [1 + 18]; ///< Requantization offset
+extern const mpc_uint8_t Res_bit [18]; ///< Bits per sample for chosen quantizer
+extern const MPC_SAMPLE_FORMAT __Cc [1 + 18]; ///< Requantization coefficients
+extern const mpc_int16_t __Dc [1 + 18]; ///< Requantization offset
#define Cc (__Cc + 1)
#define Dc (__Dc + 1)
--
2.45.2
From 60b2e2c4503cda7ae8c07fcdf68365de1d1dfe87 Mon Sep 17 00:00:00 2001
From: Schrijvers Luc <begasus@gmail.com>
Date: Fri, 12 Jul 2024 18:35:39 +0200
Subject: Fix crash, provided by waddlesplash
Co-authored-by: Augustin Cavalier <waddlesplash@gmail.com>
diff --git a/common/fastmath.c b/common/fastmath.c
old mode 100755
new mode 100644
index 2a23a59..d29d1cf
--- a/common/fastmath.c
+++ b/common/fastmath.c
@@ -21,11 +21,10 @@
#ifdef FAST_MATH
-const float tabatan2 [ 2*TABSTEP+1] [2];
-const float tabcos [26*TABSTEP+1] [2];
-const float tabsqrt_ex [256];
-const float tabsqrt_m [ TABSTEP+1] [2];
-
+float tabatan2 [ 2*TABSTEP+1] [2];
+float tabcos [26*TABSTEP+1] [2];
+float tabsqrt_ex [256];
+float tabsqrt_m [ TABSTEP+1] [2];
void Init_FastMath ( void )
{
diff --git a/include/mpc/mpcmath.h b/include/mpc/mpcmath.h
old mode 100755
new mode 100644
index 3b42a45..8a2a376
--- a/include/mpc/mpcmath.h
+++ b/include/mpc/mpcmath.h
@@ -87,10 +87,10 @@ static mpc_inline mpc_int32_t mpc_lrintf(float fVal)
# define IFLOORF(x) my_ifloor ((float)(x))
void Init_FastMath ( void );
-extern const float tabatan2 [] [2];
-extern const float tabcos [] [2];
-extern const float tabsqrt_ex [];
-extern const float tabsqrt_m [] [2];
+extern float tabatan2 [ 2*TABSTEP+1] [2];
+extern float tabcos [26*TABSTEP+1] [2];
+extern float tabsqrt_ex [256];
+extern float tabsqrt_m [ TABSTEP+1] [2];
static mpc_inline float my_atan2 ( float x, float y )
{
--
2.45.2