mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
gst/matroska/matroska-mux.c: Fix a memory leak when pads are requested but the pipeline never goes into PLAYING.
Original commit message from CVS: Patch by: Peter Kjellerstedt <pkj at axis com> * gst/matroska/matroska-mux.c: (gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad), (gst_matroska_mux_release_pad): Fix a memory leak when pads are requested but the pipeline never goes into PLAYING. Correctly remove request pads, no matter if they have collected data or not. Fixes bug #557710.
This commit is contained in:
parent
d956310612
commit
40d198cfd8
2 changed files with 21 additions and 10 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2008-10-27 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
|
Patch by: Peter Kjellerstedt <pkj at axis com>
|
||||||
|
|
||||||
|
* gst/matroska/matroska-mux.c: (gst_matroska_mux_reset),
|
||||||
|
(gst_matroska_mux_request_new_pad), (gst_matroska_mux_release_pad):
|
||||||
|
Fix a memory leak when pads are requested but the pipeline never
|
||||||
|
goes into PLAYING.
|
||||||
|
|
||||||
|
Correctly remove request pads, no matter if they have collected
|
||||||
|
data or not.
|
||||||
|
|
||||||
|
Fixes bug #557710.
|
||||||
|
|
||||||
2008-10-27 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2008-10-27 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: <lrn1986 at gmail dot com>
|
Patch by: <lrn1986 at gmail dot com>
|
||||||
|
|
|
@ -408,9 +408,6 @@ gst_matroska_mux_reset (GstElement * element)
|
||||||
collect_pad = (GstMatroskaPad *) walk->data;
|
collect_pad = (GstMatroskaPad *) walk->data;
|
||||||
thepad = collect_pad->collect.pad;
|
thepad = collect_pad->collect.pad;
|
||||||
|
|
||||||
/* free collect pad resources */
|
|
||||||
gst_matroska_pad_free (collect_pad);
|
|
||||||
|
|
||||||
/* remove from collectpads */
|
/* remove from collectpads */
|
||||||
gst_collect_pads_remove_pad (mux->collect, thepad);
|
gst_collect_pads_remove_pad (mux->collect, thepad);
|
||||||
}
|
}
|
||||||
|
@ -1362,7 +1359,9 @@ gst_matroska_mux_request_new_pad (GstElement * element,
|
||||||
newpad = gst_pad_new_from_template (templ, name);
|
newpad = gst_pad_new_from_template (templ, name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
collect_pad = (GstMatroskaPad *)
|
collect_pad = (GstMatroskaPad *)
|
||||||
gst_collect_pads_add_pad (mux->collect, newpad, sizeof (GstMatroskaPad));
|
gst_collect_pads_add_pad_full (mux->collect, newpad,
|
||||||
|
sizeof (GstMatroskaPad),
|
||||||
|
(GstCollectDataDestroyNotify) gst_matroska_pad_free);
|
||||||
|
|
||||||
/* TODO: check default values for the context */
|
/* TODO: check default values for the context */
|
||||||
context->flags = GST_MATROSKA_TRACK_ENABLED | GST_MATROSKA_TRACK_DEFAULT;
|
context->flags = GST_MATROSKA_TRACK_ENABLED | GST_MATROSKA_TRACK_DEFAULT;
|
||||||
|
@ -1424,15 +1423,13 @@ gst_matroska_mux_release_pad (GstElement * element, GstPad * pad)
|
||||||
mux->duration < collect_pad->duration)
|
mux->duration < collect_pad->duration)
|
||||||
mux->duration = collect_pad->duration;
|
mux->duration = collect_pad->duration;
|
||||||
|
|
||||||
gst_matroska_pad_free (collect_pad);
|
break;
|
||||||
gst_collect_pads_remove_pad (mux->collect, pad);
|
|
||||||
gst_element_remove_pad (element, pad);
|
|
||||||
mux->num_streams--;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_warning ("%s: unknown pad %s", GST_FUNCTION, GST_PAD_NAME (pad));
|
gst_collect_pads_remove_pad (mux->collect, pad);
|
||||||
|
if (gst_element_remove_pad (element, pad))
|
||||||
|
mux->num_streams--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue