mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
controller: add more error handling to example
This commit is contained in:
parent
158895f56b
commit
1234000942
1 changed files with 10 additions and 1 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue