After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745506 - mpegtsmux: duplicate code
mpegtsmux: duplicate code
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2015-03-03 09:36 UTC by Ilya Averyanov
Modified: 2015-03-04 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---

Patch (826 bytes, patch)
2015-03-03 09:36 UTC, Ilya Averyanov
committed Details | Review
Patch (1.04 KB, patch)
2015-03-03 09:37 UTC, Ilya Averyanov
rejected Details | Review

Description Ilya Averyanov 2015-03-03 09:36:09 UTC
Created attachment 298392 [details] [review]
mux->tsmux = tsmux_new ();
tsmux_set_write_func (mux->tsmux, new_packet_cb, mux);

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.
Comment 1 Ilya Averyanov 2015-03-03 09:37:04 UTC
Created attachment 298393 [details] [review]
Comment 2 Ilya Averyanov 2015-03-04 10:01:22 UTC
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 3 Sebastian Dröge (slomo) 2015-03-04 10:09:39 UTC
Comment on attachment 298393 [details] [review]

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.
Comment 4 Sebastian Dröge (slomo) 2015-03-04 10:10:14 UTC
Thanks for the patch :) Please reopen if you think something still needs to be done.

commit 2eac4232732912cff7ae6427b72c6b360c330daa
Author: Ilya Averyanov <>
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.