Skip to content

Commit

Permalink
Update libsamplerate (http://www.mega-nerd.com/SRC/index.html) from v…
Browse files Browse the repository at this point in the history
…ersion 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
  • Loading branch information
jyavenard committed Oct 18, 2009
1 parent 1bbde45 commit 5f7280d
Show file tree
Hide file tree
Showing 14 changed files with 364,499 additions and 22,790 deletions.
63 changes: 47 additions & 16 deletions mythtv/configure
Expand Up @@ -2921,26 +2921,57 @@ fi

# "CPU_CLIP" test for SRC / libsamplerate
# test positive wrap
check_exec << EOF && enable cpuclipspositive
int main(){
float f = (1<<(sizeof(short)*8))>>1;
short s = (short)f;
if ( s == --f )
return(0);
return(1);
}
temp_ldflags -lm
check_exec << EOF && enable cpu_clips_positive
#define _ISOC9X_SOURCE 1
#define _ISOC99_SOURCE 1
#define __USE_ISOC99 1
#define __USE_ISOC9X 1
#include <math.h>
int main (void)
{ double fval ;
int k, ival ;
fval = 1.0 * 0x7FFFFFFF ;
for (k = 0 ; k < 100 ; k++)
{
ival = (lrint (fval)) >> 24 ;
if (ival != 127)
return 1 ;
fval *= 1.2499999 ;
} ;
return 0 ;
}
EOF

# test negative wrap
check_exec << EOF && enable cpuclipsnegative
int main(){
float f = -((1<<(sizeof(short)*8))>>1) - 1;
short s = (short)f;
if ( s == ++f)
return(0);
return(1);
}
check_exec << EOF && enable cpu_clips_negative
#define _ISOC9X_SOURCE 1
#define _ISOC99_SOURCE 1
#define __USE_ISOC99 1
#define __USE_ISOC9X 1
#include <math.h>
int main (void)
{
double fval ;
int k, ival ;
fval = -8.0 * 0x10000000 ;
for (k = 0 ; k < 100 ; k++)
{
ival = (lrint (fval)) >> 24 ;
if (ival != -128)
return 1 ;
fval *= 1.2499999 ;
} ;
return 0 ;
}
EOF
restore_flags

# test for distcc
enabled distcc && check_cmd distcc --version || disable distcc
Expand Down

0 comments on commit 5f7280d

Please sign in to comment.