+2005-11-16 Michael Smith <msmith@fluendo.com>
+
+ * ext/ogg/gstoggmux.c: (gst_ogg_mux_clear), (gst_ogg_mux_reset),
+ (gst_ogg_mux_init), (gst_ogg_mux_request_new_pad),
+ (gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
+ (gst_ogg_mux_pad_queue_page), (gst_ogg_mux_queue_pads),
+ (gst_ogg_mux_collected), (gst_ogg_mux_clear_collectpads),
+ (gst_ogg_mux_change_state):
+ Fix leaking collectpads.
+
2005-11-16 Edward Hervey <edward@fluendo.com>
* gst/videorate/gstvideorate.c: (gst_videorate_blank_data),
static void
gst_ogg_mux_clear (GstOggMux * ogg_mux)
{
- ogg_mux->collect = gst_collectpads_new ();
- gst_collectpads_set_function (ogg_mux->collect,
- (GstCollectPadsFunction) gst_ogg_mux_collected, ogg_mux);
ogg_mux->pulling = NULL;
ogg_mux->need_headers = TRUE;
ogg_mux->max_delay = DEFAULT_MAX_DELAY;
ogg_mux->max_page_delay = DEFAULT_MAX_PAGE_DELAY;
-
ogg_mux->delta_pad = NULL;
+
+ if (ogg_mux->collect) {
+ gst_object_unref (ogg_mux->collect);
+ ogg_mux->collect = NULL;
+ }
+}
+
+static void
+gst_ogg_mux_reset (GstOggMux * ogg_mux)
+{
+ gst_ogg_mux_clear (ogg_mux);
+
+ ogg_mux->collect = gst_collectpads_new ();
+ gst_collectpads_set_function (ogg_mux->collect,
+ (GstCollectPadsFunction) gst_ogg_mux_collected, ogg_mux);
}
static void
/* seed random number generator for creation of serial numbers */
srand (time (NULL));
+ ogg_mux->collect = NULL;
+
gst_ogg_mux_clear (ogg_mux);
}
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
+ gst_ogg_mux_reset (ogg_mux);
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
ogg_mux->next_ts = 0;
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_collectpads_stop (ogg_mux->collect);
gst_ogg_mux_clear_collectpads (ogg_mux->collect);
- gst_ogg_mux_clear (ogg_mux);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
+ gst_ogg_mux_clear (ogg_mux);
break;
default:
break;