summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-06 23:43:47 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-06 23:43:47 +0200
commit7d9d736d1adf1f3d78c46d9747cd620ba5f0524d (patch)
tree6532ad5d46dcaafcd9669d58d3a8370e6de4a099 /src
parentclosing application when new SSRC shows up (although all depayloader are alre... (diff)
better check for elements in sink and source
Diffstat (limited to 'src')
-rw-r--r--src/pipelines.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pipelines.c b/src/pipelines.c
index c08c11f..440f183 100644
--- a/src/pipelines.c
+++ b/src/pipelines.c
@@ -64,6 +64,10 @@ static GstElement* create_avsend_src(const char* desc, GstElement* pipeline)
gst_bin_add(GST_BIN(pipeline), src);
GstElement* element = gst_bin_get_by_name(GST_BIN(src), "videosrc");
+ if(!element) {
+ log_printf(ERROR, "can't find an element 'videosrc' inside source bin");
+ return NULL;
+ }
GstPad* pad = gst_element_get_static_pad(element, "src");
if(!gst_element_add_pad(src, gst_ghost_pad_new("video", pad))) {
log_printf(ERROR, "can't create video ghost pad for source bin");
@@ -73,6 +77,10 @@ static GstElement* create_avsend_src(const char* desc, GstElement* pipeline)
gst_object_unref(GST_OBJECT(element));
element = gst_bin_get_by_name(GST_BIN(src), "audiosrc");
+ if(!element) {
+ log_printf(ERROR, "can't find an element 'audiosrc' inside source bin");
+ return NULL;
+ }
pad = gst_element_get_static_pad(element, "src");
if(!gst_element_add_pad(src, gst_ghost_pad_new("audio", pad))) {
log_printf(ERROR, "can't create audio ghost pad for source bin");
@@ -126,6 +134,10 @@ static GstElement* create_avrecv_sink(const char* desc, GstElement* pipeline)
gst_bin_add(GST_BIN(pipeline), sink);
GstElement* element = gst_bin_get_by_name(GST_BIN(sink), "videosink");
+ if(!element) {
+ log_printf(ERROR, "can't find an element 'videosink' inside sink bin");
+ return NULL;
+ }
GstPad* pad = gst_element_get_static_pad(element, "sink");
if(!gst_element_add_pad(sink, gst_ghost_pad_new("video", pad))) {
log_printf(ERROR, "can't create video ghost pad for source bin");
@@ -135,6 +147,10 @@ static GstElement* create_avrecv_sink(const char* desc, GstElement* pipeline)
gst_object_unref(GST_OBJECT(element));
element = gst_bin_get_by_name(GST_BIN(sink), "audiosink");
+ if(!element) {
+ log_printf(ERROR, "can't find an element 'audiosink' inside sink bin");
+ return NULL;
+ }
pad = gst_element_get_static_pad(element, "sink");
if(!gst_element_add_pad(sink, gst_ghost_pad_new("audio", pad))) {
log_printf(ERROR, "can't create audio ghost pad for source bin");