summaryrefslogtreecommitdiffstats
path: root/freebsd/dependencies/akode/files/patch-b01-add-pulseaudio-support.diff
blob: 4cc1580864db97e131dc4e9cda357661f0260b3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
commit cf18d66ac5c3904f3f932848f761ec5d103a470c
Author: François Andriot <francois.andriot@free.fr>
Date:   Thu Oct 15 04:42:48 2015 +0200

    Add pulseaudio support
    [taken from Fedora patches]

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8e2d94..df5b7ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,7 +49,7 @@ OPTION( WITH_LIBLTDL "Build with libltdl" ${WITH_ALL_OPTIONS} )
 
 OPTION( WITH_ALSA_SINK "Build with alsa sink" ${WITH_ALL_OPTIONS} )
 OPTION( WITH_JACK_SINK "Build with jack sink" ${WITH_ALL_OPTIONS} )
-OPTION( WITH_POLYP_SINK "Build with polyp sink" OFF )
+OPTION( WITH_PULSE_SINK "Build with pulseaudio sink" OFF )
 OPTION( WITH_OSS_SINK "Build with oss sink" ${WITH_ALL_OPTIONS} )
 OPTION( WITH_SUN_SINK "Build with sun sink" OFF )
 
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index df4d86a..635db2e 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -118,15 +118,15 @@ endif( WITH_OSS_SINK )
 
 ##### check polyp support #######################
 
-if( WITH_POLYP_SINK )
+if( WITH_PULSE_SINK )
 
-    pkg_search_module( POLYP polyplib-simple>=0.70 )
+    pkg_search_module( PULSE libpulse-simple>=0.9.2 )
 
-    if( NOT POLYP_FOUND )
-        tde_message_fatal( "polyplib-simple >= 0.70 are required, but not found on your system" )
-    endif( NOT POLYP_FOUND )
+    if( NOT PULSE_FOUND )
+        tde_message_fatal( "libpulse-simple >= 0.9.2 are required, but not found on your system" )
+    endif( NOT PULSE_FOUND )
 
-endif( WITH_POLYP_SINK )
+endif( WITH_PULSE_SINK )
 
 
 ##### check sun support #########################
diff --git a/akode/plugins/CMakeLists.txt b/akode/plugins/CMakeLists.txt
index ce0f3a4..6e11f1a 100644
--- a/akode/plugins/CMakeLists.txt
+++ b/akode/plugins/CMakeLists.txt
@@ -15,7 +15,7 @@
 tde_conditional_add_subdirectory( WITH_ALSA_SINK alsa_sink )
 tde_conditional_add_subdirectory( WITH_JACK_SINK jack_sink )
 tde_conditional_add_subdirectory( WITH_OSS_SINK oss_sink )
-tde_conditional_add_subdirectory( WITH_POLYP_SINK polyp_sink )
+tde_conditional_add_subdirectory( WITH_PULSE_SINK polyp_sink )
 tde_conditional_add_subdirectory( WITH_SUN_SINK sun_sink )
 
 tde_conditional_add_subdirectory( WITH_FFMPEG_DECODER ffmpeg_decoder )
diff --git a/akode/plugins/polyp_sink/CMakeLists.txt b/akode/plugins/polyp_sink/CMakeLists.txt
index 90c4f3c..28a940e 100644
--- a/akode/plugins/polyp_sink/CMakeLists.txt
+++ b/akode/plugins/polyp_sink/CMakeLists.txt
@@ -15,7 +15,7 @@ include_directories(
   ${CMAKE_SOURCE_DIR}/akode/lib
   ${CMAKE_CURRENT_BINARY_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}
-  ${POLYP_INCLUDE_DIRS}
+  ${PULSE_INCLUDE_DIRS}
 )
 
 
@@ -26,7 +26,7 @@ set( target libakode_polyp_sink )
 tde_add_library(
   ${target} MODULE
   SOURCES polyp_sink.cpp
-  LINK akode-shared ${POLYP_LIBRARIES}
+  LINK akode-shared ${PULSE_LIBRARIES}
   DESTINATION ${LIB_INSTALL_DIR}
 )
 
diff --git a/akode/plugins/polyp_sink/Makefile.am b/akode/plugins/polyp_sink/Makefile.am
index b67602a..a58b04c 100644
--- a/akode/plugins/polyp_sink/Makefile.am
+++ b/akode/plugins/polyp_sink/Makefile.am
@@ -1,7 +1,7 @@
-INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(POLYP_CFLAGS) $(all_includes)
+INCLUDES = -I$(top_srcdir)/akode/lib -I$(top_builddir)/akode/lib $(PULSE_CFLAGS) $(all_includes)
 
 lib_LTLIBRARIES	= libakode_polyp_sink.la
 
 libakode_polyp_sink_la_SOURCES = polyp_sink.cpp
-libakode_polyp_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(POLYP_LDFLAGS)
-libakode_polyp_sink_la_LIBADD = ../../lib/libakode.la $(POLYP_LIBADD)
+libakode_polyp_sink_la_LDFLAGS = -module -avoid-version -no-undefined $(PULSE_LDFLAGS)
+libakode_polyp_sink_la_LIBADD = ../../lib/libakode.la $(PULSE_LIBADD)
diff --git a/akode/plugins/polyp_sink/polyp_sink.cpp b/akode/plugins/polyp_sink/polyp_sink.cpp
index 9376dac..b48b63e 100644
--- a/akode/plugins/polyp_sink/polyp_sink.cpp
+++ b/akode/plugins/polyp_sink/polyp_sink.cpp
@@ -25,7 +25,7 @@
 #elif defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
 #endif
-#include <polyp/polyplib-simple.h>
+#include <pulse/simple.h>
 
 #include "audioframe.h"
 #include "audiobuffer.h"
@@ -59,7 +59,7 @@ PolypSink::PolypSink()
 
 bool PolypSink::open() {
     int error = 0;
-    m_data->server = pa_simple_new(0, "akode-client", PA_STREAM_PLAYBACK, 0, "", &m_data->sample_spec, 0, 255, &error );
+    m_data->server = pa_simple_new(0, "akode-client", PA_STREAM_PLAYBACK, 0, "", &m_data->sample_spec, 0, 0, &error );
     if (!m_data->server || error != 0) {
         m_data->error = true;
         close();
diff --git a/config.h.in b/config.h.in
index 7fe6faf..eed77f8 100644
--- a/config.h.in
+++ b/config.h.in
@@ -43,9 +43,9 @@
 /* Define if you have libOggFLAC (required for loading OggFLAC files) */
 #undef HAVE_LIBOGGFLAC
 
-/* Define if you have polyplib (required if you want Polypaudio server
+/* Define if you have libpulse (required if you want PulseAudio server
    support) */
-#undef HAVE_LIBPOLYP
+#undef HAVE_LIBPULSE
 
 /* defined if you have libsamplerate library and header */
 #undef HAVE_LIBSAMPLERATE