GNOME Bugzilla – Bug 745506
mpegtsmux: duplicate code
Last modified: 2015-03-04 11:00:42 UTC
Created attachment 298392 [details] [review] Patch http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst/mpegtsmux/mpegtsmux.c#n315 call mux->tsmux = tsmux_new (); tsmux_set_write_func (mux->tsmux, new_packet_cb, mux); in http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst/mpegtsmux/mpegtsmux.c#n330 call mpegtsmux_reset which also call mux->tsmux = tsmux_new (); tsmux_set_write_func (mux->tsmux, new_packet_cb, mux); mpegtsmux_reset always free mux->tsmux. but we can free only in mpegtsmux_dispose.
Created attachment 298393 [details] [review] Patch
Sorry attachment 298393 [details] [review] patch not correct. Because mpegtsmux_reset also call from mpegtsmux_change_state. But first attachment 298392 [details] [review] still actual
Comment on attachment 298393 [details] [review] Patch This does not look correct. In GST_STATE_CHANGE_PAUSED_TO_READY we would allocate a new instance without freeing the old one. The current code should always free the instance already.
Thanks for the patch :) Please reopen if you think something still needs to be done. commit 2eac4232732912cff7ae6427b72c6b360c330daa Author: Ilya Averyanov <i.averyanov@geoscan.aero> Date: Mon Mar 2 01:08:15 2015 +0300 mpegtsmux: Remove duplicate code The muxer is already allocated in reset(), which is called soon afterwards. https://bugzilla.gnome.org/show_bug.cgi?id=745506