aboutsummaryrefslogtreecommitdiff
path: root/multimedia/gstreamer-plugins80/files/patch-ext_musepack_gstmusepackdec.cpp
blob: 1b1799ca9a98b06528b4d0c937384a9b26df826e (plain) (blame)
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
--- ext/musepack/gstmusepackdec.cpp.orig	Sun Nov  7 19:30:06 2004
+++ ext/musepack/gstmusepackdec.cpp	Thu Dec 16 16:31:42 2004
@@ -30,14 +30,24 @@
     GST_STATIC_CAPS ("audio/x-musepack")
     );
 
+#ifdef MPC_FIXED_POINT
+#define BASE_CAPS \
+  "audio/x-raw-int, " \
+    "signed = (bool) TRUE, " \
+    "width = (int) 32, " \
+    "depth = (int) 32"
+#else
+#define BASE_CAPS \
+  "audio/x-raw-float, " \
+    "width = (int) 32, " \
+    "buffer-frames = (int) 0"
+#endif
+
 static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("audio/x-raw-int, "
+    GST_STATIC_CAPS (BASE_CAPS ", "
         "endianness = (int) BYTE_ORDER, "
-        "signed = (bool) TRUE, "
-        "width = (int) 32, "
-        "depth = (int) 32, "
         "rate = (int) [ 8000, 96000 ], "
         "channels = (int) [ 1, 2 ]")
     );
@@ -352,6 +362,7 @@
 gst_musepack_stream_init (GstMusepackDec * musepackdec)
 {
   StreamInfo si = StreamInfo ();
+  GstCaps *caps;
 
   if (musepackdec->dec)
     delete musepackdec->dec;
@@ -379,15 +390,12 @@
     return FALSE;
   }
 
-  if (!gst_pad_set_explicit_caps (musepackdec->srcpad,
-           gst_caps_new_simple ("audio/x-raw-int",
-               "width", G_TYPE_INT, 32,
-               "depth", G_TYPE_INT, 32,
-               "endianness", G_TYPE_INT, G_BYTE_ORDER,
-               "channels", G_TYPE_INT, si.simple.Channels,
-               "rate", G_TYPE_INT, si.simple.SampleFreq,
-               "signed", G_TYPE_BOOLEAN, TRUE,
-               NULL))) {
+  caps = gst_caps_from_string (BASE_CAPS);
+  gst_caps_set_simple (caps,
+      "endianness", G_TYPE_INT, G_BYTE_ORDER,
+      "channels", G_TYPE_INT, si.simple.Channels,
+      "rate", G_TYPE_INT, si.simple.SampleFreq, NULL);
+  if (!gst_pad_set_explicit_caps (musepackdec->srcpad, caps)) {
     GST_ELEMENT_ERROR (musepackdec, CORE, NEGOTIATION, (NULL), (NULL));
     delete musepackdec->dec;
     musepackdec->dec = NULL;