aboutsummaryrefslogtreecommitdiff
path: root/libraries/opal/opal-3.6.7-celt-0.7-update.patch
blob: 045a2008103448a631f9f5244261e66cf9ba354c (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
--- a/plugins/audio/celt/celtcodec.c
+++ b/plugins/audio/celt/celtcodec.c
@@ -52,7 +52,12 @@ static int init_mode(CELTContext *celt, const struct PluginCodec_Definition * co
 {
   int error = 0;
 
-  celt->mode = celt_mode_create(codec->sampleRate, 1, codec->parm.audio.samplesPerFrame, &error);
+  celt->mode = celt_mode_create(codec->sampleRate,
+#if !defined(HAVE_CELT_0_7_0_OR_LATER)
+				1,
+#endif
+				codec->parm.audio.samplesPerFrame,
+				&error);
   if (celt->mode == NULL) {
     return FALSE;
   }
@@ -65,6 +70,9 @@ static int init_mode(CELTContext *celt, const struct PluginCodec_Definition * co
 
 static void * celt_create_encoder(const struct PluginCodec_Definition * codec)
 {
+#if defined(HAVE_CELT_0_7_0_OR_LATER)
+  int error = 0;
+#endif
   CELTContext * celt = malloc(sizeof(CELTContext));
   if (celt == NULL)
     return NULL;
@@ -73,8 +81,12 @@ static void * celt_create_encoder(const struct PluginCodec_Definition * codec)
     free(celt);
     return NULL;
   }
- 	
+
+#if defined(HAVE_CELT_0_7_0_OR_LATER)
+  celt->encoder_state = celt_encoder_create(celt->mode, 1, &error);
+#else
   celt->encoder_state = celt_encoder_create(celt->mode);
+#endif
   if (celt->encoder_state == NULL ) {
     celt_mode_destroy(celt->mode);
     free(celt);
@@ -87,6 +99,9 @@ static void * celt_create_encoder(const struct PluginCodec_Definition * codec)
 
 static void * celt_create_decoder(const struct PluginCodec_Definition * codec)
 {
+#if defined(HAVE_CELT_0_7_0_OR_LATER)
+  int error = 0;
+#endif
   CELTContext * celt = malloc(sizeof(CELTContext));
   if (celt == NULL)
     return NULL;
@@ -96,7 +111,11 @@ static void * celt_create_decoder(const struct PluginCodec_Definition * codec)
     return NULL;
   }
 
+#if defined(HAVE_CELT_0_7_0_OR_LATER)
+  celt->decoder_state = celt_decoder_create(celt->mode, 1, &error);
+#else
   celt->decoder_state = celt_decoder_create(celt->mode);
+#endif
   if (celt->decoder_state == NULL ) {
     celt_mode_destroy(celt->mode);
     free(celt);
@@ -142,7 +161,9 @@ static int celt_codec_encoder(const struct PluginCodec_Definition * codec,
   if (*toLen < celt->bytes_per_packet)
     return FALSE;
 
-#ifdef HAVE_CELT_0_5_0_OR_LATER
+#if defined(HAVE_CELT_0_7_0_OR_LATER)
+  byteCount = celt_encode(celt->encoder_state, (celt_int16 *)fromPtr, NULL, (char *)toPtr, celt->bytes_per_packet);
+#elif defined(HAVE_CELT_0_5_0_OR_LATER)
   byteCount = celt_encode(celt->encoder_state, (celt_int16_t *)fromPtr, NULL, (char *)toPtr, celt->bytes_per_packet);
 #else
   byteCount = celt_encode(celt->encoder_state, (celt_int16_t *)fromPtr, (char *)toPtr, celt->bytes_per_packet);
--- a/plugins/configure.ac
+++ b/plugins/configure.ac
@@ -313,9 +313,12 @@
                    AC_SUBST(CELT_LIBS)
                    AC_DEFINE([HAVE_CELT], [1], [celt])
                    HAVE_CELT=yes
-                   PKG_CHECK_EXISTS([celt >= 0.5.0],
-                                     [
-                                      AC_DEFINE([HAVE_CELT_0_5_0_OR_LATER], [1], [celt 0.5.0 or later found])
+                   PKG_CHECK_EXISTS([celt >= 0.7.0], [
+                                      AC_DEFINE([HAVE_CELT_0_7_0_OR_LATER], [1], [celt 0.7.0 or later found])
+                                     ],
+                                     [PKG_CHECK_EXISTS([celt >= 0.5.0], [
+                                                   AC_DEFINE([HAVE_CELT_0_5_0_OR_LATER], [1], [celt 0.5.0 or later found])
+                                     ])
                    ])
                   ],
                   [
--- a/plugins/plugin-config.h.in	2010-02-14 16:07:28.000000000 +0100
+++ b/plugins/plugin-config.h.in	2010-02-14 16:07:42.000000000 +0100
@@ -15,6 +15,9 @@
 /* celt 0.5.0 or later found */
 #undef HAVE_CELT_0_5_0_OR_LATER
 
+/* celt 0.7.0 or later found */
+#undef HAVE_CELT_0_7_0_OR_LATER
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H