mpegtsmux: fix release_pad
Remove bogus freeing of pad element_private data that we never set (collectpads uses it, which causes confusion here). Also, check that our collectpads instance exists before using it. Partial fix for #636011.
This commit is contained in:
parent
92d5ea2926
commit
455aaa3fbd
@ -800,30 +800,17 @@ static void
|
|||||||
mpegtsmux_release_pad (GstElement * element, GstPad * pad)
|
mpegtsmux_release_pad (GstElement * element, GstPad * pad)
|
||||||
{
|
{
|
||||||
MpegTsMux *mux = GST_MPEG_TSMUX (element);
|
MpegTsMux *mux = GST_MPEG_TSMUX (element);
|
||||||
MpegTsPadData *pad_data = NULL;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (mux, "Pad %" GST_PTR_FORMAT " being released", pad);
|
GST_DEBUG_OBJECT (mux, "Pad %" GST_PTR_FORMAT " being released", pad);
|
||||||
|
|
||||||
/* Get the MpegTsPadData out of the pad */
|
if (mux->collect) {
|
||||||
GST_OBJECT_LOCK (pad);
|
|
||||||
pad_data = (MpegTsPadData *) gst_pad_get_element_private (pad);
|
|
||||||
if (G_LIKELY (pad_data)) {
|
|
||||||
/* Free codec data reference if any */
|
|
||||||
if (pad_data->codec_data) {
|
|
||||||
GST_DEBUG_OBJECT (element, "releasing codec_data reference");
|
|
||||||
gst_buffer_unref (pad_data->codec_data);
|
|
||||||
pad_data->codec_data = NULL;
|
|
||||||
}
|
|
||||||
if (pad_data->prepare_data && pad_data->free_func) {
|
|
||||||
pad_data->free_func (pad_data->prepare_data);
|
|
||||||
pad_data->prepare_data = pad_data->free_func = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GST_OBJECT_UNLOCK (pad);
|
|
||||||
|
|
||||||
gst_collect_pads_remove_pad (mux->collect, pad);
|
gst_collect_pads_remove_pad (mux->collect, pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* chain up */
|
||||||
|
gst_element_remove_pad (element, pad);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
new_packet_cb (guint8 * data, guint len, void *user_data, gint64 new_pcr)
|
new_packet_cb (guint8 * data, guint len, void *user_data, gint64 new_pcr)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user