if (srcpadname != NULL) {
srcpad = gst_element_get_pad(previous,srcpadname);
if (!srcpad) {
+ srcpad = gst_element_request_pad_by_name(previous,srcpadname);
+ }
+ if (!srcpad) {
GST_DEBUG(0,"NO SUCH pad %s in element %s\n",srcpadname,GST_ELEMENT_NAME(previous));
- }
+ }
}
else if (srcpad == NULL) {
// check through the list to find the first sink pad
sinkpad = NULL;
- if (sinkpadname != NULL)
- sinkpad = gst_element_get_pad(previous,sinkpadname);
-
+ if (sinkpadname != NULL){
+ sinkpad = gst_element_get_pad(element,sinkpadname);
+
+ if (!sinkpad) {
+ sinkpad = gst_element_request_pad_by_name(element,sinkpadname);
+ }
+ }
+
if (!sinkpad) {
// check through the list to find the first sink pad
pads = gst_element_get_pad_list(element);