[mythtv-commits] Ticket #456: libmythsamplerate distributed preconfigured for x86

MythTV mythtv at cvs.mythtv.org
Wed Oct 12 12:42:11 UTC 2005


#456: libmythsamplerate distributed preconfigured for x86
------------------------------+---------------------------------------------
 Reporter:  foobum at gmail.com  |       Owner:  ijr
     Type:  patch             |      Status:  new
 Priority:  minor             |   Milestone:     
Component:  mythtv            |     Version:     
 Severity:  medium            |  ------------------------------+---------------------------------------------
 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

-- 
Ticket URL: <http://cvs.mythtv.org/trac/ticket/456>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list