]> err.no Git - mapper/commitdiff
Fixes to gstreamer element and caps handlings.
authorKaj-Michael Lang <milang@onion.tal.org>
Fri, 29 Feb 2008 13:55:00 +0000 (15:55 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Fri, 29 Feb 2008 13:55:00 +0000 (15:55 +0200)
src/speak.c

index 190cd95d3a8b751d9f823aae92a4bada9685924f..c5a67ad2ac46ae90447756c6a09c735362a18e75 100644 (file)
@@ -41,7 +41,6 @@ struct _gst_espeak {
        GstElement *pipeline;
        GstElement *src;
        GstElement *queue;
-       GstElement *caps;
        GstElement *sink;
        gboolean done;
        gshort  *buffer;
@@ -98,9 +97,6 @@ g_assert(ge.pipeline);
 ge.src=gst_element_factory_make("appsrc", "source");
 g_assert(ge.src);
 
-ge.caps=gst_element_factory_make("capsfilter", "caps");
-g_assert(ge.caps);
-
 ge.srccaps=gst_caps_new_simple ("audio/x-raw-int",
                        "depth", G_TYPE_INT, 16,
                        "signed", G_TYPE_BOOLEAN, TRUE, 
@@ -116,17 +112,16 @@ g_assert(ge.queue);
 ge.sink=gst_element_factory_make(AUDIO_SINK, "sink");
 g_assert(ge.sink);
 
-g_object_set(ge.caps, "caps", ge.srccaps, NULL);
-
 gst_bin_add_many (GST_BIN(ge.pipeline), ge.src, ge.queue, ge.sink, NULL);
 
 if (!gst_element_link_filtered(ge.src, ge.queue, ge.srccaps)) {
-       g_warning ("Failed to link elements 1!");
+       g_warning ("Failed to link source to queue with caps.");
        return FALSE;
 }
+gst_caps_unref(ge.srccaps);
 
-if (!gst_element_link_filtered(ge.queue, ge.sink, ge.srccaps)) {
-       g_warning ("Failed to link elements 2!");
+if (!gst_element_link(ge.queue, ge.sink)) {
+       g_warning ("Failed to link queue to sink.");
        return FALSE;
 }