gst_queue_handle_src_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
+ GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
+ if (G_UNLIKELY (queue == NULL))
+ return FALSE;
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)",
res = gst_pad_push_event (queue->sinkpad, event);
+ gst_object_unref (queue);
return res;
}
gst_queue2_handle_src_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue2 *queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
+ GstQueue2 *queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ if (G_UNLIKELY (queue == NULL))
+ return FALSE;
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)",
break;
}
+ gst_object_unref (queue);
return res;
}