<div dir="ltr"><div><div><div>Hi,</div><div><br></div><div>I am getting following error when I am trying to play a media file with my sample gstreamer player:</div><div><br></div><div><br></div><div>(im_gst_play:3723): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GstPad'</div>
<div><br></div><div>(im_gst_play:3723): GStreamer-CRITICAL **: gst_element_remove_pad: assertion `GST_IS_PAD (pad)' failed</div></div><div><br></div><div><br></div><div>I found that error was getting generated from "gst_element_remove_pad" function call:</div>
<div><br></div><div>In my demux element I am using "gst_element_remove_pad" in following way in finalize method of demux element:</div><div><br></div><div> im_gst_element_unregister_sinkpad (im_element, im_element->sink_pad);</div>
<div><br></div><div> if (!gst_element_remove_pad(GST_ELEMENT_CAST(demux), GST_PAD(im_element->sink_pad)))</div><div> {</div><div> GST_ERROR_OBJECT (demux, "Error removing pad");</div><div> }</div><div><br>
</div><div>implementation of function "im_gst_element_unregister_sinkpad " is given below:</div><div><br></div><div> gboolean im_gst_element_unregister_sinkpad (ImGstElement * im_element, ImGstPad * pad)</div><div>
{ </div><div> ImGstElementSinkPad *pad_node_data = NULL;</div><div> g_mutex_lock (im_element->pad_list_mutex);</div><div> pad_node_data = im_gst_element_get_sink_pad_nodedata(im_element, pad);</div><div> g_static_rec_mutex_free (pad_node_data->adapter_lock);</div>
<div> g_free (pad_node_data->adapter_lock);</div><div> pad_node_data->adapter_lock = NULL;</div><div> gst_adapter_clear(pad_node_data->adapter);</div><div> g_object_unref(pad_node_data->adapter);</div><div>
pad_node_data->adapter = NULL;</div><div><br></div><div> im_element->sink_pads = g_list_remove (im_element->sink_pads, (gconstpointer) pad_node_data);</div><div> g_free(pad_node_data);</div><div> g_mutex_unlock (im_element->pad_list_mutex);</div>
<div> return TRUE;</div><div>}</div></div><div><br></div><div><div> Can somebody help me to find out why this assertion is getting generated?</div></div><div><br></div><div>Thanks,</div><div>Yogesh</div><div><br></div></div>