diff options
author | Edward Hervey <bilboed@bilboed.com> | 2008-10-15 17:45:37 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2008-10-15 17:45:37 +0000 |
commit | f1c7c8cea0d06011c42875d588afe2c6781b60fb (patch) | |
tree | 3f1d5f4dbd7c5c230d4bd170ef418d850d9af8b5 /gst/selector | |
parent | 847dd7016ebba64aeaa5e726a3549117958307df (diff) | |
download | gst-plugins-bad-f1c7c8cea0d06011c42875d588afe2c6781b60fb.tar.gz gst-plugins-bad-f1c7c8cea0d06011c42875d588afe2c6781b60fb.tar.bz2 gst-plugins-bad-f1c7c8cea0d06011c42875d588afe2c6781b60fb.zip |
gst/selector/gstinputselector.c: Gracefully handle the cases when we dont' have otherpad.
Original commit message from CVS:
* gst/selector/gstinputselector.c: (gst_input_selector_event),
(gst_input_selector_query):
Gracefully handle the cases when we dont' have otherpad.
Fixes #556430
Diffstat (limited to 'gst/selector')
-rw-r--r-- | gst/selector/gstinputselector.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c index 45f2af9d..c175a5e0 100644 --- a/gst/selector/gstinputselector.c +++ b/gst/selector/gstinputselector.c @@ -1017,15 +1017,16 @@ gst_input_selector_get_linked_pad (GstPad * pad, gboolean strict) static gboolean gst_input_selector_event (GstPad * pad, GstEvent * event) { - gboolean res; + gboolean res = FALSE; GstPad *otherpad; otherpad = gst_input_selector_get_linked_pad (pad, TRUE); - res = gst_pad_push_event (otherpad, event); - - gst_object_unref (otherpad); + if (otherpad) { + res = gst_pad_push_event (otherpad, event); + gst_object_unref (otherpad); + } return res; } @@ -1034,7 +1035,7 @@ gst_input_selector_event (GstPad * pad, GstEvent * event) static gboolean gst_input_selector_query (GstPad * pad, GstQuery * query) { - gboolean res; + gboolean res = TRUE; GstInputSelector *sel; GstPad *otherpad; @@ -1101,10 +1102,12 @@ gst_input_selector_query (GstPad * pad, GstQuery * query) break; } default: - res = gst_pad_peer_query (otherpad, query); + if (otherpad) + res = gst_pad_peer_query (otherpad, query); break; } - gst_object_unref (otherpad); + if (otherpad) + gst_object_unref (otherpad); gst_object_unref (sel); return res; |