From 602d342c69b13dc92ab9920177e56adc02195d58 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Fri, 29 Feb 2008 15:55:00 +0200 Subject: [PATCH] Fixes to gstreamer element and caps handlings. --- src/speak.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/speak.c b/src/speak.c index 190cd95..c5a67ad 100644 --- a/src/speak.c +++ b/src/speak.c @@ -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; } -- 2.39.5