[pulseaudio-commits] r1753 - in /branches/lennart/src/pulsecore: core-util.c resampler.c resampler.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Sep 2 14:20:57 PDT 2007


Author: lennart
Date: Sun Sep  2 23:20:57 2007
New Revision: 1753

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1753&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Allow compilation without libsamplerate; based on patch from Marc-Andre Lur=
eau; re #125

Modified:
    branches/lennart/src/pulsecore/core-util.c
    branches/lennart/src/pulsecore/resampler.c
    branches/lennart/src/pulsecore/resampler.h

Modified: branches/lennart/src/pulsecore/core-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
core-util.c?rev=3D1753&root=3Dpulseaudio&r1=3D1752&r2=3D1753&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/core-util.c (original)
+++ branches/lennart/src/pulsecore/core-util.c Sun Sep  2 23:20:57 2007
@@ -78,7 +78,9 @@
 #include <grp.h>
 #endif
 =

+#ifdef HAVE_LIBSAMPLERATE
 #include <samplerate.h>
+#endif
 =

 #include <pulse/xmalloc.h>
 #include <pulse/util.h>

Modified: branches/lennart/src/pulsecore/resampler.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
resampler.c?rev=3D1753&root=3Dpulseaudio&r1=3D1752&r2=3D1753&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/resampler.c (original)
+++ branches/lennart/src/pulsecore/resampler.c Sun Sep  2 23:20:57 2007
@@ -27,7 +27,9 @@
 =

 #include <string.h>
 =

+#if HAVE_LIBSAMPLERATE
 #include <samplerate.h>
+#endif =

 =

 #include <liboil/liboilfuncs.h>
 #include <liboil/liboil.h>
@@ -70,9 +72,11 @@
         unsigned i_counter;
     } trivial;
 =

+#ifdef HAVE_LIBSAMPLERATE
     struct { /* data specific to libsamplerate */
         SRC_STATE *state;
     } src;
+#endif
 =

     struct { /* data specific to speex */
         SpeexResamplerState* state;
@@ -84,7 +88,6 @@
     } ffmpeg;
 };
 =

-static int libsamplerate_init(pa_resampler*r);
 static int trivial_init(pa_resampler*r);
 static int speex_init(pa_resampler*r);
 static int ffmpeg_init(pa_resampler*r);
@@ -92,11 +95,19 @@
 static void calc_map_table(pa_resampler *r);
 =

 static int (* const init_table[])(pa_resampler*r) =3D {
+#ifdef HAVE_LIBSAMPLERATE
     [PA_RESAMPLER_SRC_SINC_BEST_QUALITY]   =3D libsamplerate_init,
     [PA_RESAMPLER_SRC_SINC_MEDIUM_QUALITY] =3D libsamplerate_init,
     [PA_RESAMPLER_SRC_SINC_FASTEST]        =3D libsamplerate_init,
     [PA_RESAMPLER_SRC_ZERO_ORDER_HOLD]     =3D libsamplerate_init,
     [PA_RESAMPLER_SRC_LINEAR]              =3D libsamplerate_init,
+#else
+    [PA_RESAMPLER_SRC_SINC_BEST_QUALITY]   =3D NULL,
+    [PA_RESAMPLER_SRC_SINC_MEDIUM_QUALITY] =3D NULL,
+    [PA_RESAMPLER_SRC_SINC_FASTEST]        =3D NULL,
+    [PA_RESAMPLER_SRC_ZERO_ORDER_HOLD]     =3D NULL,
+    [PA_RESAMPLER_SRC_LINEAR]              =3D NULL,
+#endif    =

     [PA_RESAMPLER_TRIVIAL]                 =3D trivial_init,
     [PA_RESAMPLER_SPEEX_FLOAT_BASE+0]      =3D speex_init,
     [PA_RESAMPLER_SPEEX_FLOAT_BASE+1]      =3D speex_init,
@@ -622,6 +633,7 @@
 =

 /*** libsamplerate based implementation ***/
 =

+#ifdef HAVE_LIBSAMPLERATE
 static void libsamplerate_resample(pa_resampler *r, const pa_memchunk *inp=
ut, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) {
     SRC_DATA data;
     =

@@ -677,6 +689,7 @@
 =

     return 0;
 }
+#endif
 =

 /*** speex based implementation ***/
 =


Modified: branches/lennart/src/pulsecore/resampler.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
resampler.h?rev=3D1753&root=3Dpulseaudio&r1=3D1752&r2=3D1753&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/resampler.h (original)
+++ branches/lennart/src/pulsecore/resampler.h Sun Sep  2 23:20:57 2007
@@ -24,8 +24,6 @@
   USA.
 ***/
 =

-#include <samplerate.h>
-
 #include <pulse/sample.h>
 #include <pulse/channelmap.h>
 #include <pulsecore/memblock.h>
@@ -35,11 +33,11 @@
 =

 typedef enum pa_resample_method {
     PA_RESAMPLER_INVALID                 =3D -1,
-    PA_RESAMPLER_SRC_SINC_BEST_QUALITY   =3D SRC_SINC_BEST_QUALITY,
-    PA_RESAMPLER_SRC_SINC_MEDIUM_QUALITY =3D SRC_SINC_MEDIUM_QUALITY,
-    PA_RESAMPLER_SRC_SINC_FASTEST        =3D SRC_SINC_FASTEST,
-    PA_RESAMPLER_SRC_ZERO_ORDER_HOLD     =3D SRC_ZERO_ORDER_HOLD,
-    PA_RESAMPLER_SRC_LINEAR              =3D SRC_LINEAR,
+    PA_RESAMPLER_SRC_SINC_BEST_QUALITY   =3D 0, /* =3D SRC_SINC_BEST_QUALI=
TY */
+    PA_RESAMPLER_SRC_SINC_MEDIUM_QUALITY =3D 1, /* =3D SRC_SINC_MEDIUM_QUA=
LITY */
+    PA_RESAMPLER_SRC_SINC_FASTEST        =3D 2, /* =3D SRC_SINC_FASTEST */
+    PA_RESAMPLER_SRC_ZERO_ORDER_HOLD     =3D 3, /* =3D SRC_ZERO_ORDER_HOLD=
 */
+    PA_RESAMPLER_SRC_LINEAR              =3D 4, /* =3D SRC_LINEAR */
     PA_RESAMPLER_TRIVIAL,
     PA_RESAMPLER_SPEEX_FLOAT_BASE,
     PA_RESAMPLER_SPEEX_FLOAT_MAX =3D PA_RESAMPLER_SPEEX_FLOAT_BASE + 10,




More information about the pulseaudio-commits mailing list