From: Thiago Santos Date: Thu, 11 Jul 2013 03:05:17 +0000 (-0300) Subject: pad-monitor: only set pad functions if they exist on the pad X-Git-Tag: 1.19.3~491^2~2646 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ba50106f2915cff8e07db4ffa190e9d866202a0;p=platform%2Fupstream%2Fgstreamer.git pad-monitor: only set pad functions if they exist on the pad Some functions should only be set on pads if they were originally set, like the GetRange, Chain and BufferAlloc --- diff --git a/validate/gst/qa/gst-qa-pad-monitor.c b/validate/gst/qa/gst-qa-pad-monitor.c index 1a95c39..c53a424 100644 --- a/validate/gst/qa/gst-qa-pad-monitor.c +++ b/validate/gst/qa/gst-qa-pad-monitor.c @@ -155,12 +155,17 @@ gst_qa_pad_monitor_do_setup (GstQaMonitor * monitor) if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK) { pad_monitor->bufferalloc_func = GST_PAD_BUFFERALLOCFUNC (pad); - gst_pad_set_bufferalloc_function (pad, gst_qa_pad_buffer_alloc_func); + if (pad_monitor->bufferalloc_func) + gst_pad_set_bufferalloc_function (pad, gst_qa_pad_buffer_alloc_func); + pad_monitor->chain_func = GST_PAD_CHAINFUNC (pad); - gst_pad_set_chain_function (pad, gst_qa_pad_monitor_chain_func); + if (pad_monitor->chain_func) + gst_pad_set_chain_function (pad, gst_qa_pad_monitor_chain_func); + } else { pad_monitor->getrange_func = GST_PAD_GETRANGEFUNC (pad); - gst_pad_set_getrange_function (pad, gst_qa_pad_get_range_func); + if (pad_monitor->getrange_func) + gst_pad_set_getrange_function (pad, gst_qa_pad_get_range_func); } pad_monitor->event_func = GST_PAD_EVENTFUNC (pad); pad_monitor->query_func = GST_PAD_QUERYFUNC (pad);