Opened 14 years ago

Closed 14 years ago

#456 closed patch (fixed)

libmythsamplerate distributed preconfigured for x86

Reported by: foobum@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version:
Severity: medium Keywords:
Cc: Ticket locked: no

Description

libmythsamplerate (the src directory of SRC aka libsamplerate) is distributed (.18.1) 'pre-configured' on an x86 box, which means that the defines in samplerate_config.h are incorrect on x86_64 (and presumably other archs). This leads to nasty clicking when using the resampler on x86_64 (noticed when using mythmusic + OSS + spdif out). I've deleted samplerate_config.h and added tests to the top-level configure script to fix this.


diff -u mythtv-0.18.1/configure mythtv-0.18.1-p/configure --- mythtv-0.18.1/configure 2005-05-05 08:15:43.000000000 +0100 +++ mythtv-0.18.1-p/configure 2005-10-12 13:21:19.000000000 +0100 @@ -1169,6 +1169,37 @@

fi

+# "CPU_CLIP" test for SRC / libsamplerate +# test positive wrap +cat > $TMPC << EOF +int main(){ + float f = (1<<(sizeof(short)*8))>>1; + short s = (short)f; + if ( s == --f ) + return(0); + return(1); +} +EOF + +if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then +$TMPE && cpuclipspositive="yes" +fi + +# test negative wrap +cat > $TMPC << EOF +int main(){ + float f = -((1<<(sizeof(short)*8))>>1) - 1; + short s = (short)f; + if ( s == ++f) + return(0); + return(1); +} +EOF + +if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then +$TMPE && cpuclipsnegative="yes" +fi +

# test for distcc if test x"$distcc" = x"yes"; then

if test x"distcc --version 2> /dev/null" = x""; then

@@ -1930,6 +1961,16 @@

echo "#define HAVE_MMX 1" >> $TMPH echo "#define CPU 586" >> $TMPH

fi

+if test "$cpuclipspositive" = "yes"; then + echo "#define CPU_CLIPS_POSITIVE 1" >> $TMPH +else + echo "#define CPU_CLIPS_POSITIVE 0" >> $TMPH +fi +if test "$cpuclipsnegative" = "yes"; then + echo "#define CPU_CLIPS_NEGATIVE 1" >> $TMPH +else + echo "#define CPU_CLIPS_NEGATIVE 0" >> $TMPH +fi

#if test "$builtin_vector" = "yes" ; then # echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak # echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH


diff -u mythtv-0.18.1/libs/libmythsamplerate/samplerate.c mythtv-0.18.1-p/libs/libmythsamplerate/samplerate.c --- mythtv-0.18.1/libs/libmythsamplerate/samplerate.c 2004-10-26 02:16:38.000000000 +0100 +++ mythtv-0.18.1-p/libs/libmythsamplerate/samplerate.c 2005-10-12 13:38:35.000000000 +0100 @@ -21,7 +21,6 @@

#include <string.h>

#include "config.h"

-#include "samplerate_config.h"

#include "samplerate.h" #include "common.h"

Only in mythtv-0.18.1/libs/libmythsamplerate/: samplerate_config.h

Attachments (2)

configure.diff (1.5 KB) - added by foobum@… 14 years ago.
libmythsamplerate.diff (531 bytes) - added by foobum@… 14 years ago.

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by foobum@…

Attachment: configure.diff added

Changed 14 years ago by foobum@…

Attachment: libmythsamplerate.diff added

comment:1 Changed 14 years ago by anonymous

Hmm.. Guess I should have read the WikiFormatting link..

Diffs attached.

comment:2 Changed 14 years ago by danielk

Resolution: fixed
Status: newclosed

(In [7510]) Closes #456 by applying patches. re-run ./configure

Note: See TracTickets for help on using tickets.