3rdparty/libsamplerate: updated to version 0.1.8

Updated 3rdparty libsamplerate to version 0.1.8 and bumped requirement
to system's libsamplerate to version 0.1.8.
This commit is contained in:
Tobias Doerffel
2012-02-02 20:36:26 +01:00
parent 5662ef9d44
commit 89078c09a2
11 changed files with 69 additions and 22 deletions

View File

@@ -322,7 +322,7 @@ ENDIF(LMMS_BUILD_WIN32)
# check for libsamplerate
IF(WANT_SYSTEM_SR)
PKG_CHECK_MODULES(SAMPLERATE samplerate>=0.1.7)
PKG_CHECK_MODULES(SAMPLERATE samplerate>=0.1.8)
IF(SAMPLERATE_FOUND)
SET(LMMS_HAVE_SAMPLERATE TRUE)
ENDIF(SAMPLERATE_FOUND)

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/
@@ -46,6 +46,18 @@ typedef long int32_t ;
#define MAKE_MAGIC(a,b,c,d,e,f) ((a) + ((b) << 4) + ((c) << 8) + ((d) << 12) + ((e) << 16) + ((f) << 20))
/*
** Inspiration : http://sourcefrog.net/weblog/software/languages/C/unused.html
*/
#ifdef UNUSED
#elif defined (__GNUC__)
# define UNUSED(x) UNUSED_ ## x __attribute__ ((unused))
#elif defined (__LCLINT__)
# define UNUSED(x) /*@unused@*/ x
#else
# define UNUSED(x) x
#endif
#ifdef __GNUC__
# define WARN_UNUSED __attribute__ ((warn_unused_result))
#else

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2001-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2001-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
@@ -16,7 +16,7 @@
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* Version 1.4 */
/* Version 1.5 */
#ifndef FLOAT_CAST_HEADER
#define FLOAT_CAST_HEADER
@@ -121,6 +121,32 @@
return retval ;
} /* float2int */
#elif (defined (WIN64) || defined(_WIN64))
/* Win64 section should be places before Win32 one, because
** most likely both WIN32 and WIN64 will be defined in 64-bit case.
*/
#include <math.h>
/* Win64 doesn't seem to have these functions, nor inline assembly.
** Therefore implement inline versions of these functions here.
*/
#include <emmintrin.h>
#include <mmintrin.h>
__inline long int
lrint(double flt)
{
return _mm_cvtsd_si32(_mm_load_sd(&flt));
}
__inline long int
lrintf(float flt)
{
return _mm_cvtss_si32(_mm_load_ss(&flt));
}
#elif (defined (WIN32) || defined (_WIN32))
#undef HAVE_LRINT_REPLACEMENT

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2007-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2007-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2007-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2007-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/
@@ -58,6 +58,9 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data)
double src_ratio, input_index, rem ;
int ch ;
if (data->input_frames <= 0)
return SRC_ERR_NO_ERROR ;
if (psrc->private_data == NULL)
return SRC_ERR_NO_PRIVATE ;

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/
@@ -1166,7 +1166,7 @@ prepare_data (SINC_FILTER *filter, SRC_DATA *data, int half_filter_chan_len)
len = MIN (filter->in_count - filter->in_used, len) ;
len -= (len % filter->channels) ;
if (len < 0 || filter->b_end + len > filter->b_len)
if (len < 0 || filter->b_end + len > filter->b_len)
return SRC_ERR_SINC_PREPARE_DATA_BAD_LEN ;
memcpy (filter->buffer + filter->b_end, data->data_in + filter->in_used,
@@ -1194,6 +1194,9 @@ prepare_data (SINC_FILTER *filter, SRC_DATA *data, int half_filter_chan_len)
filter->b_real_end = filter->b_end ;
len = half_filter_chan_len + 5 ;
if (len < 0 || filter->b_end + len > filter->b_len)
len = filter->b_len - filter->b_end ;
memset (filter->buffer + filter->b_end, 0, len * sizeof (filter->buffer [0])) ;
filter->b_end += len ;
} ;

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
/*
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
** use license for this code is available, please see:
** http://www.mega-nerd.com/SRC/procedure.html
*/
@@ -56,6 +56,9 @@ zoh_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data)
double src_ratio, input_index, rem ;
int ch ;
if (data->input_frames <= 0)
return SRC_ERR_NO_ERROR ;
if (psrc->private_data == NULL)
return SRC_ERR_NO_PRIVATE ;