From 58fae1723b26536925dfc62c7c5eacf5335d131e5d8192738339db26dff5f58c Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Wed, 15 Aug 2007 19:56:51 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/speex?expand=0&rev=4 --- speex-resample-fix.diff | 63 +++++++++++++++++++++++++++++++++++++++++ speex.changes | 7 +++++ speex.spec | 23 +++++++++------ 3 files changed, 84 insertions(+), 9 deletions(-) create mode 100644 speex-resample-fix.diff diff --git a/speex-resample-fix.diff b/speex-resample-fix.diff new file mode 100644 index 0000000..8729ef6 --- /dev/null +++ b/speex-resample-fix.diff @@ -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;iden_rate;i++) + { +- spx_uint32_t j; ++ spx_int32_t j; + for (j=0;jfilt_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;inb_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; diff --git a/speex.changes b/speex.changes index d828821..932577a 100644 --- a/speex.changes +++ b/speex.changes @@ -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 diff --git a/speex.spec b/speex.spec index e5c0335..bbd4eb5 100644 --- a/speex.spec +++ b/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