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
|
diff --git a/decode.c b/decode.c
index 05fcdce..d9d9fa2 100644
--- a/decode.c
+++ b/decode.c
@@ -131,14 +131,24 @@ void decode_init(log_level level, const char *opt) {
// register codecs
// alc,wma,wmap,wmal,aac,spt,ogg,ogf,flc,aif,pcm,mp3
i = 0;
+#ifndef SL_NO_AAC
if (!opt || strstr(opt, "aac")) codecs[i++] = register_faad();
+#endif
+#ifndef SL_NO_OGG
if (!opt || strstr(opt, "ogg")) codecs[i++] = register_vorbis();
+#endif
+#ifndef SL_NO_FLAC
if (!opt || strstr(opt, "flac")) codecs[i++] = register_flac();
+#endif
if (!opt || strstr(opt, "pcm")) codecs[i++] = register_pcm();
// try mad then mpg for mp3 unless command line option passed
+#ifndef SL_NO_MAD
if ( !opt || strstr(opt, "mp3") || strstr(opt, "mad")) codecs[i] = register_mad();
+#endif
+#ifndef SL_NO_MPG123
if ((!opt || strstr(opt, "mp3") || strstr(opt, "mpg")) && !codecs[i]) codecs[i] = register_mpg();
+#endif
mutex_create(decode.mutex);
diff --git a/faad.c b/faad.c
index 6adb88a..33a7f10 100644
--- a/faad.c
+++ b/faad.c
@@ -20,6 +20,8 @@
#include "squeezelite.h"
+#ifndef SL_NO_AAC
+
#include <neaacdec.h>
#define WRAPBUF_LEN 2048
@@ -601,3 +603,5 @@ struct codec *register_faad(void) {
return &ret;
}
+
+#endif
diff --git a/flac.c b/flac.c
index 5d22bfe..cab6601 100644
--- a/flac.c
+++ b/flac.c
@@ -20,6 +20,8 @@
#include "squeezelite.h"
+#ifndef SL_NO_FLAC
+
#include <FLAC/stream_decoder.h>
struct flac {
@@ -253,3 +255,5 @@ struct codec *register_flac(void) {
return &ret;
}
+
+#endif
diff --git a/mad.c b/mad.c
index 0e73b35..5058656 100644
--- a/mad.c
+++ b/mad.c
@@ -20,6 +20,8 @@
#include "squeezelite.h"
+#ifndef SL_NO_MAD
+
#include <mad.h>
#define MAD_DELAY 529
@@ -350,3 +352,5 @@ struct codec *register_mad(void) {
return &ret;
}
+
+#endif
diff --git a/mpg.c b/mpg.c
index 4142282..7326af8 100644
--- a/mpg.c
+++ b/mpg.c
@@ -20,6 +20,8 @@
#include "squeezelite.h"
+#ifndef SL_NO_MAD
+
#include <mpg123.h>
#define READ_SIZE 512
@@ -261,3 +263,5 @@ struct codec *register_mpg(void) {
return &ret;
}
+
+#endif
diff --git a/vorbis.c b/vorbis.c
index 37c544c..56eb046 100644
--- a/vorbis.c
+++ b/vorbis.c
@@ -20,6 +20,8 @@
#include "squeezelite.h"
+#ifndef SL_NO_OGG
+
// automatically select between floating point (preferred) and fixed point libraries:
// NOTE: works with Tremor version here: http://svn.xiph.org/trunk/Tremor, not vorbisidec.1.0.2 currently in ubuntu
@@ -293,3 +295,5 @@ struct codec *register_vorbis(void) {
return &ret;
}
+
+#endif
|