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;
}
static gboolean
gst_input_selector_query (GstPad * pad, GstQuery * query)
{
- gboolean res;
+ gboolean res = TRUE;
GstInputSelector *sel;
GstPad *otherpad;
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;