[packages/speex] - add speex_1.2~rc1-7.diff from debian - package pdf doc in -devel

glen glen at pld-linux.org
Sat Jan 5 20:58:12 CET 2013


commit 394a412772efd70b9eaf159bfa2dca36e28927e9
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Jan 5 21:51:58 2013 +0200

    - add speex_1.2~rc1-7.diff from debian
    - package pdf doc in -devel

 speex.spec           |  25 +++++++------
 speex_1.2~rc1-7.diff | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 116 insertions(+), 12 deletions(-)
---
diff --git a/speex.spec b/speex.spec
index 2740d78..adc3381 100644
--- a/speex.spec
+++ b/speex.spec
@@ -1,19 +1,20 @@
 #
 # Conditional build:
 %bcond_without	static_libs	# don't build static library
-#
-%define		bver	rc1
-%define		rel	2
+
+%define		subver	rc1
+%define		rel	3
 Summary:	An open-source, patent-free speech codec
 Summary(pl.UTF-8):	Otwarty kodek mowy, wolny od patentów
 Name:		speex
 Version:	1.2
-Release:	%{bver}.%{rel}
+Release:	%{subver}.%{rel}
 Epoch:		1
 License:	BSD
 Group:		Libraries
-Source0:	http://downloads.xiph.org/releases/speex/%{name}-%{version}%{bver}.tar.gz
+Source0:	http://downloads.xiph.org/releases/speex/%{name}-%{version}%{subver}.tar.gz
 # Source0-md5:	c4438b22c08e5811ff10e2b06ee9b9ae
+Patch0:		%{name}_1.2~rc1-7.diff
 URL:		http://www.speex.org/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -70,8 +71,8 @@ Obsoletes:	Speex-progs
 
 %description progs
 Utilities for the Speex codec: speexdec (decodes a Speex file and
-produces a WAV or raw file) and speexenc (encodes file from WAV or
-raw format using Speex).
+produces a WAV or raw file) and speexenc (encodes file from WAV or raw
+format using Speex).
 
 %description progs -l pl.UTF-8
 Narzędzia do kodeka Speex: speexdec (dekodujące plik Speex i tworzące
@@ -79,7 +80,8 @@ plik WAV lub raw) oraz speexenc (kodujący plik z formatu WAV lub raw
 przy użyciu kodeka Speex).
 
 %prep
-%setup -q -n %{name}-%{version}%{bver}
+%setup -q -n %{name}-%{version}%{subver}
+%patch0 -p1
 
 %build
 %{__libtoolize}
@@ -93,21 +95,19 @@ przy użyciu kodeka Speex).
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT \
-	docdir=%{_docdir}/%{name}
+	doc_DATA=
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-
 %post	-p /sbin/ldconfig
 %postun -p /sbin/ldconfig
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog NEWS README TODO doc/manual.pdf
+%doc AUTHORS COPYING ChangeLog NEWS README TODO
 %attr(755,root,root) %{_libdir}/libspeex.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libspeex.so.1
 %attr(755,root,root) %{_libdir}/libspeexdsp.so.*.*.*
@@ -115,6 +115,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
+%doc doc/manual.pdf
 %attr(755,root,root) %{_libdir}/libspeex.so
 %attr(755,root,root) %{_libdir}/libspeexdsp.so
 %{_libdir}/libspeex.la
diff --git a/speex_1.2~rc1-7.diff b/speex_1.2~rc1-7.diff
new file mode 100644
index 0000000..1d87d64
--- /dev/null
+++ b/speex_1.2~rc1-7.diff
@@ -0,0 +1,103 @@
+--- speex-1.2~rc1.orig/libspeex/resample.c
++++ speex-1.2~rc1/libspeex/resample.c
+@@ -561,8 +561,8 @@
+       st->cutoff = quality_map[st->quality].downsample_bandwidth * st->den_rate / st->num_rate;
+       /* FIXME: divide the numerator and denominator by a certain amount if they're too large */
+       st->filt_len = st->filt_len*st->num_rate / st->den_rate;
+-      /* Round down to make sure we have a multiple of 4 */
+-      st->filt_len &= (~0x3);
++      /* Round up to make sure we have a multiple of 8 for SSE */
++      st->filt_len = ((st->filt_len-1)&(~0x7))+8;
+       if (2*st->den_rate < st->num_rate)
+          st->oversample >>= 1;
+       if (4*st->den_rate < st->num_rate)
+@@ -579,7 +579,7 @@
+    }
+    
+    /* Choose the resampling type that requires the least amount of memory */
+-   if (st->den_rate <= st->oversample)
++   if (st->filt_len*st->den_rate <= st->filt_len*st->oversample+8)
+    {
+       spx_uint32_t i;
+       if (!st->sinc_table)
+@@ -756,9 +756,9 @@
+ #endif
+    
+    /* Per channel data */
+-   st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(int));
+-   st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int));
+-   st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int));
++   st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(spx_int32_t));
++   st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
++   st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
+    for (i=0;i<nb_channels;i++)
+    {
+       st->last_sample[i] = 0;
+@@ -954,13 +954,15 @@
+ {
+    spx_uint32_t i;
+    int istride_save, ostride_save;
+-   spx_uint32_t bak_len = *out_len;
++   spx_uint32_t bak_out_len = *out_len;
++   spx_uint32_t bak_in_len = *in_len;
+    istride_save = st->in_stride;
+    ostride_save = st->out_stride;
+    st->in_stride = st->out_stride = st->nb_channels;
+    for (i=0;i<st->nb_channels;i++)
+    {
+-      *out_len = bak_len;
++      *out_len = bak_out_len;
++      *in_len = bak_in_len;
+       if (in != NULL)
+          speex_resampler_process_float(st, i, in+i, in_len, out+i, out_len);
+       else
+@@ -975,13 +977,15 @@
+ {
+    spx_uint32_t i;
+    int istride_save, ostride_save;
+-   spx_uint32_t bak_len = *out_len;
++   spx_uint32_t bak_out_len = *out_len;
++   spx_uint32_t bak_in_len = *in_len;
+    istride_save = st->in_stride;
+    ostride_save = st->out_stride;
+    st->in_stride = st->out_stride = st->nb_channels;
+    for (i=0;i<st->nb_channels;i++)
+    {
+-      *out_len = bak_len;
++      *out_len = bak_out_len;
++      *in_len = bak_in_len;
+       if (in != NULL)
+          speex_resampler_process_int(st, i, in+i, in_len, out+i, out_len);
+       else
+--- speex-1.2~rc1.orig/libspeex/speex_header.c
++++ speex-1.2~rc1/libspeex/speex_header.c
+@@ -147,20 +147,21 @@
+    int i;
+    SpeexHeader *le_header;
+    const char *h = "Speex   ";
+-   for (i=0;i<8;i++)
+-      if (packet[i]!=h[i])
+-      {
+-         speex_notify("This doesn't look like a Speex file");
+-         return NULL;
+-      }
+-   
++
+    /*FIXME: Do we allow larger headers?*/
+    if (size < (int)sizeof(SpeexHeader))
+    {
+       speex_notify("Speex header too small");
+       return NULL;
+    }
+-   
++
++   for (i=0;i<8;i++)
++      if (packet[i]!=h[i])
++      {
++         speex_notify("This doesn't look like a Speex file");
++         return NULL;
++      }
++
+    le_header = (SpeexHeader*)speex_alloc(sizeof(SpeexHeader));
+    
+    SPEEX_COPY(le_header, (SpeexHeader*)packet, 1);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/speex.git/commitdiff/394a412772efd70b9eaf159bfa2dca36e28927e9



More information about the pld-cvs-commit mailing list