This commit is contained in:
parent
0f01ac81a5
commit
58fae1723b
63
speex-resample-fix.diff
Normal file
63
speex-resample-fix.diff
Normal file
@ -0,0 +1,63 @@
|
||||
--- libspeex/resample.c-dist 2007-08-14 16:59:01.000000000 +0200
|
||||
+++ libspeex/resample.c 2007-08-13 11:20:08.000000000 +0200
|
||||
@@ -84,6 +84,7 @@ static void speex_free (void *ptr) {free
|
||||
#define OVERSAMPLE 8
|
||||
|
||||
#define IMAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
+#define IMIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
@@ -576,10 +577,10 @@ static void update_filter(SpeexResampler
|
||||
}
|
||||
for (i=0;i<st->den_rate;i++)
|
||||
{
|
||||
- spx_uint32_t j;
|
||||
+ spx_int32_t j;
|
||||
for (j=0;j<st->filt_len;j++)
|
||||
{
|
||||
- st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
|
||||
+ st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-(spx_int32_t)st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
|
||||
}
|
||||
}
|
||||
#ifdef FIXED_POINT
|
||||
@@ -997,16 +998,19 @@ void speex_resampler_get_rate(SpeexResam
|
||||
|
||||
int speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate)
|
||||
{
|
||||
- int fact;
|
||||
+ spx_uint32_t fact;
|
||||
+ spx_uint32_t old_den;
|
||||
+ spx_uint32_t i;
|
||||
if (st->in_rate == in_rate && st->out_rate == out_rate && st->num_rate == ratio_num && st->den_rate == ratio_den)
|
||||
return RESAMPLER_ERR_SUCCESS;
|
||||
|
||||
+ old_den = st->den_rate;
|
||||
st->in_rate = in_rate;
|
||||
st->out_rate = out_rate;
|
||||
st->num_rate = ratio_num;
|
||||
st->den_rate = ratio_den;
|
||||
/* FIXME: This is terribly inefficient, but who cares (at least for now)? */
|
||||
- for (fact=2;fact<=sqrt(IMAX(in_rate, out_rate));fact++)
|
||||
+ for (fact=2;fact<=IMIN(st->num_rate, st->den_rate);fact++)
|
||||
{
|
||||
while ((st->num_rate % fact == 0) && (st->den_rate % fact == 0))
|
||||
{
|
||||
@@ -1015,6 +1019,17 @@ int speex_resampler_set_rate_frac(SpeexR
|
||||
}
|
||||
}
|
||||
|
||||
+ if (old_den > 0)
|
||||
+ {
|
||||
+ for (i=0;i<st->nb_channels;i++)
|
||||
+ {
|
||||
+ st->samp_frac_num[i]=st->samp_frac_num[i]*st->den_rate/old_den;
|
||||
+ /* Safety net */
|
||||
+ if (st->samp_frac_num[i] >= st->den_rate)
|
||||
+ st->samp_frac_num[i] = st->den_rate-1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (st->initialised)
|
||||
update_filter(st);
|
||||
return RESAMPLER_ERR_SUCCESS;
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 14 17:00:55 CEST 2007 - tiwai@suse.de
|
||||
|
||||
- fix the bug in resampler code (signed/unsigned mismatch)
|
||||
- move man pages to the main package
|
||||
- a bit clean up of spec file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 24 14:38:03 CEST 2007 - tiwai@suse.de
|
||||
|
||||
|
23
speex.spec
23
speex.spec
@ -15,12 +15,13 @@ Name: speex
|
||||
BuildRequires: libogg-devel pkgconfig
|
||||
Summary: An Open Source, Patent Free Speech Codec
|
||||
Version: 1.1.99.2
|
||||
Release: 1
|
||||
License: BSD License and BSD-like
|
||||
Release: 18
|
||||
License: BSD 3-Clause
|
||||
Group: System/Libraries
|
||||
URL: http://www.speex.org/
|
||||
Source: %{name}-%{package_version}.tar.bz2
|
||||
Patch1: speex-1.0.5-warning-fix.diff
|
||||
Patch2: speex-resample-fix.diff
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -42,7 +43,7 @@ Authors:
|
||||
|
||||
%package -n libspeex
|
||||
Summary: An Open Source, Patent Free Speech Codec Library
|
||||
License: BSD License and BSD-like
|
||||
License: BSD 3-Clause
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libspeex
|
||||
@ -64,7 +65,7 @@ Authors:
|
||||
|
||||
%package devel
|
||||
Summary: Development package for SpeeX
|
||||
License: BSD License and BSD-like
|
||||
License: BSD 3-Clause
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libspeex glibc-devel
|
||||
|
||||
@ -86,18 +87,18 @@ Authors:
|
||||
%prep
|
||||
%setup -q -n %{name}-%{package_version}
|
||||
%patch1
|
||||
%patch2
|
||||
|
||||
%build
|
||||
%{?suse_update_config:%{suse_update_config -f}}
|
||||
autoreconf --force --install
|
||||
CFLAGS="$RPM_OPT_FLAGS -DRELEASE" \
|
||||
./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
|
||||
autoreconf -fi
|
||||
%configure \
|
||||
--disable-static \
|
||||
--with-ogg-libraries=%{_libdir}
|
||||
make
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
%makeinstall
|
||||
# remove duped documents
|
||||
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/speex-*
|
||||
# remove unneeded *.la files
|
||||
@ -116,6 +117,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS ChangeLog COPYING NEWS README TODO
|
||||
%{_bindir}/*
|
||||
%doc %{_mandir}/man?/*
|
||||
|
||||
%files -n libspeex
|
||||
%defattr(-,root,root)
|
||||
@ -124,7 +126,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%doc README.TI-DSP README.blackfin README.symbian
|
||||
%doc %{_mandir}/man?/*
|
||||
%doc doc/manual.pdf
|
||||
%{_includedir}/*
|
||||
%{_libdir}/libspeex.so
|
||||
@ -132,6 +133,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/aclocal/*.m4
|
||||
|
||||
%changelog
|
||||
* Tue Aug 14 2007 - tiwai@suse.de
|
||||
- fix the bug in resampler code (signed/unsigned mismatch)
|
||||
- move man pages to the main package
|
||||
- a bit clean up of spec file
|
||||
* Thu May 24 2007 - tiwai@suse.de
|
||||
- updated to version 1.2beta2:
|
||||
* reduced RAM requirement
|
||||
|
Loading…
x
Reference in New Issue
Block a user