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
This commit is contained in:
Thiago Santos 2013-07-11 00:05:17 -03:00
parent 5ac4579358
commit 7ba50106f2

View file

@ -155,11 +155,16 @@ gst_qa_pad_monitor_do_setup (GstQaMonitor * monitor)
if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK) {
pad_monitor->bufferalloc_func = GST_PAD_BUFFERALLOCFUNC (pad);
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);
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);
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);