From 1234000942a093db0ee587d4a9e2a695cf7e5985 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Fri, 22 May 2009 23:50:58 +0300 Subject: [PATCH] controller: add more error handling to example --- tests/examples/controller/audio-example.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/examples/controller/audio-example.c b/tests/examples/controller/audio-example.c index 2045fd8..544152c 100644 --- a/tests/examples/controller/audio-example.c +++ b/tests/examples/controller/audio-example.c @@ -31,7 +31,16 @@ main (gint argc, gchar ** argv) bin = gst_pipeline_new ("pipeline"); clock = gst_pipeline_get_clock (GST_PIPELINE (bin)); src = gst_element_factory_make ("audiotestsrc", "gen_audio"); - sink = gst_element_factory_make ("alsasink", "play_audio"); + if (!src) { + GST_WARNING ("need audiotestsrc from gst-plugins-base"); + goto Error; + } + sink = gst_element_factory_make ("autoaudiosink", "play_audio"); + if (!sink) { + GST_WARNING ("need autoaudiosink from gst-plugins-base"); + goto Error; + } + gst_bin_add_many (GST_BIN (bin), src, sink, NULL); if (!gst_element_link (src, sink)) { GST_WARNING ("can't link elements"); -- 2.7.4