Skip to content

Commit 5f7280d

Browse files
committed
Update libsamplerate (http://www.mega-nerd.com/SRC/index.html) from version 0.1.2 (Nov 28 2002) to 0.1.7 (Feb 14 2009).
Fix detection of CPU positive/negative clipping in configure (it was always detected as false). git-svn-id: http://svn.mythtv.org/svn/trunk@22521 7dbf422c-18fa-0310-86e9-fd20926502f2
1 parent 1bbde45 commit 5f7280d

File tree

14 files changed

+364499
-22790
lines changed

14 files changed

+364499
-22790
lines changed

mythtv/configure

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,26 +2921,57 @@ fi
29212921

29222922
# "CPU_CLIP" test for SRC / libsamplerate
29232923
# test positive wrap
2924-
check_exec << EOF && enable cpuclipspositive
2925-
int main(){
2926-
float f = (1<<(sizeof(short)*8))>>1;
2927-
short s = (short)f;
2928-
if ( s == --f )
2929-
return(0);
2930-
return(1);
2931-
}
2924+
temp_ldflags -lm
2925+
check_exec << EOF && enable cpu_clips_positive
2926+
#define _ISOC9X_SOURCE 1
2927+
#define _ISOC99_SOURCE 1
2928+
#define __USE_ISOC99 1
2929+
#define __USE_ISOC9X 1
2930+
#include <math.h>
2931+
int main (void)
2932+
{ double fval ;
2933+
int k, ival ;
2934+
2935+
fval = 1.0 * 0x7FFFFFFF ;
2936+
for (k = 0 ; k < 100 ; k++)
2937+
{
2938+
ival = (lrint (fval)) >> 24 ;
2939+
if (ival != 127)
2940+
return 1 ;
2941+
2942+
fval *= 1.2499999 ;
2943+
} ;
2944+
2945+
return 0 ;
2946+
}
29322947
EOF
29332948

29342949
# test negative wrap
2935-
check_exec << EOF && enable cpuclipsnegative
2936-
int main(){
2937-
float f = -((1<<(sizeof(short)*8))>>1) - 1;
2938-
short s = (short)f;
2939-
if ( s == ++f)
2940-
return(0);
2941-
return(1);
2942-
}
2950+
check_exec << EOF && enable cpu_clips_negative
2951+
#define _ISOC9X_SOURCE 1
2952+
#define _ISOC99_SOURCE 1
2953+
#define __USE_ISOC99 1
2954+
#define __USE_ISOC9X 1
2955+
#include <math.h>
2956+
int main (void)
2957+
{
2958+
double fval ;
2959+
int k, ival ;
2960+
2961+
fval = -8.0 * 0x10000000 ;
2962+
for (k = 0 ; k < 100 ; k++)
2963+
{
2964+
ival = (lrint (fval)) >> 24 ;
2965+
if (ival != -128)
2966+
return 1 ;
2967+
2968+
fval *= 1.2499999 ;
2969+
} ;
2970+
2971+
return 0 ;
2972+
}
29432973
EOF
2974+
restore_flags
29442975

29452976
# test for distcc
29462977
enabled distcc && check_cmd distcc --version || disable distcc

0 commit comments

Comments
 (0)