g_list_free (mux->streamheader);
mux->streamheader = NULL;
}
+ gst_event_replace (&mux->force_key_unit_event, NULL);
GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
}
out:
if (forward)
res = ts_data->eventfunc (pad, event);
+ else
+ gst_event_unref (event);
gst_object_unref (mux);
return res;
mpegtsmux_src_event (GstPad * pad, GstEvent * event)
{
MpegTsMux *mux = GST_MPEG_TSMUX (gst_pad_get_parent (pad));
- gboolean res = TRUE;
+ gboolean res = TRUE, forward = TRUE;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CUSTOM_UPSTREAM:
if (!gst_video_event_is_force_key_unit (event))
break;
+ forward = FALSE;
+
gst_video_event_parse_upstream_force_key_unit (event,
&running_time, &all_headers, &count);
break;
}
default:
- res = gst_pad_event_default (pad, event);
break;
}
+ if (forward)
+ res = gst_pad_event_default (pad, event);
+ else
+ gst_event_unref (event);
+
gst_object_unref (mux);
return res;
}
typedef struct _TestData
{
GstEvent *sink_event;
- GstEvent *src_event1;
- GstEvent *src_event2;
gint src_events;
} TestData;
{
TestData *data = (TestData *) gst_pad_get_element_private (pad);
- if (event->type == GST_EVENT_CUSTOM_UPSTREAM) {
+ if (event->type == GST_EVENT_CUSTOM_UPSTREAM)
data->src_events += 1;
- if (data->src_event1 != NULL)
- data->src_event2 = event;
- else
- data->src_event1 = event;
- }
+ gst_event_unref (event);
return TRUE;
}
if (event->type == GST_EVENT_CUSTOM_DOWNSTREAM)
data->sink_event = event;
+ gst_event_unref (event);
return TRUE;
}