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
|
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
|
BuildRequires: libogg-devel pkgconfig
|
||||||
Summary: An Open Source, Patent Free Speech Codec
|
Summary: An Open Source, Patent Free Speech Codec
|
||||||
Version: 1.1.99.2
|
Version: 1.1.99.2
|
||||||
Release: 1
|
Release: 18
|
||||||
License: BSD License and BSD-like
|
License: BSD 3-Clause
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
URL: http://www.speex.org/
|
URL: http://www.speex.org/
|
||||||
Source: %{name}-%{package_version}.tar.bz2
|
Source: %{name}-%{package_version}.tar.bz2
|
||||||
Patch1: speex-1.0.5-warning-fix.diff
|
Patch1: speex-1.0.5-warning-fix.diff
|
||||||
|
Patch2: speex-resample-fix.diff
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -42,7 +43,7 @@ Authors:
|
|||||||
|
|
||||||
%package -n libspeex
|
%package -n libspeex
|
||||||
Summary: An Open Source, Patent Free Speech Codec Library
|
Summary: An Open Source, Patent Free Speech Codec Library
|
||||||
License: BSD License and BSD-like
|
License: BSD 3-Clause
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
|
|
||||||
%description -n libspeex
|
%description -n libspeex
|
||||||
@ -64,7 +65,7 @@ Authors:
|
|||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development package for SpeeX
|
Summary: Development package for SpeeX
|
||||||
License: BSD License and BSD-like
|
License: BSD 3-Clause
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: libspeex glibc-devel
|
Requires: libspeex glibc-devel
|
||||||
|
|
||||||
@ -86,18 +87,18 @@ Authors:
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{package_version}
|
%setup -q -n %{name}-%{package_version}
|
||||||
%patch1
|
%patch1
|
||||||
|
%patch2
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{?suse_update_config:%{suse_update_config -f}}
|
%{?suse_update_config:%{suse_update_config -f}}
|
||||||
autoreconf --force --install
|
autoreconf -fi
|
||||||
CFLAGS="$RPM_OPT_FLAGS -DRELEASE" \
|
%configure \
|
||||||
./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
|
|
||||||
--disable-static \
|
--disable-static \
|
||||||
--with-ogg-libraries=%{_libdir}
|
--with-ogg-libraries=%{_libdir}
|
||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make DESTDIR=$RPM_BUILD_ROOT install
|
%makeinstall
|
||||||
# remove duped documents
|
# remove duped documents
|
||||||
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/speex-*
|
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/speex-*
|
||||||
# remove unneeded *.la files
|
# remove unneeded *.la files
|
||||||
@ -116,6 +117,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc AUTHORS ChangeLog COPYING NEWS README TODO
|
%doc AUTHORS ChangeLog COPYING NEWS README TODO
|
||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
|
%doc %{_mandir}/man?/*
|
||||||
|
|
||||||
%files -n libspeex
|
%files -n libspeex
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@ -124,7 +126,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc README.TI-DSP README.blackfin README.symbian
|
%doc README.TI-DSP README.blackfin README.symbian
|
||||||
%doc %{_mandir}/man?/*
|
|
||||||
%doc doc/manual.pdf
|
%doc doc/manual.pdf
|
||||||
%{_includedir}/*
|
%{_includedir}/*
|
||||||
%{_libdir}/libspeex.so
|
%{_libdir}/libspeex.so
|
||||||
@ -132,6 +133,10 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_datadir}/aclocal/*.m4
|
%{_datadir}/aclocal/*.m4
|
||||||
|
|
||||||
%changelog
|
%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
|
* Thu May 24 2007 - tiwai@suse.de
|
||||||
- updated to version 1.2beta2:
|
- updated to version 1.2beta2:
|
||||||
* reduced RAM requirement
|
* reduced RAM requirement
|
||||||
|
Loading…
x
Reference in New Issue
Block a user