mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-12 14:51:42 +00:00
oggmux: fix leak when initializing pads
Pads are initialized twice: when requesting pads and when initializing collectpads. Avoid double initialization by checking if collectpads are still going to be initialized when creating request pads.
This commit is contained in:
parent
4fc4aeee71
commit
08022bddc8
1 changed files with 7 additions and 2 deletions
|
@ -467,7 +467,6 @@ gst_ogg_mux_request_new_pad (GstElement * element,
|
||||||
ogg_mux->active_pads++;
|
ogg_mux->active_pads++;
|
||||||
|
|
||||||
oggpad->map.serialno = serial;
|
oggpad->map.serialno = serial;
|
||||||
ogg_stream_init (&oggpad->map.stream, oggpad->map.serialno);
|
|
||||||
oggpad->packetno = 0;
|
oggpad->packetno = 0;
|
||||||
oggpad->pageno = 0;
|
oggpad->pageno = 0;
|
||||||
oggpad->eos = FALSE;
|
oggpad->eos = FALSE;
|
||||||
|
@ -477,12 +476,18 @@ gst_ogg_mux_request_new_pad (GstElement * element,
|
||||||
oggpad->first_delta = FALSE;
|
oggpad->first_delta = FALSE;
|
||||||
oggpad->prev_delta = FALSE;
|
oggpad->prev_delta = FALSE;
|
||||||
oggpad->data_pushed = FALSE;
|
oggpad->data_pushed = FALSE;
|
||||||
oggpad->pagebuffers = g_queue_new ();
|
|
||||||
oggpad->map.headers = NULL;
|
oggpad->map.headers = NULL;
|
||||||
oggpad->map.queued = NULL;
|
oggpad->map.queued = NULL;
|
||||||
oggpad->next_granule = 0;
|
oggpad->next_granule = 0;
|
||||||
oggpad->keyframe_granule = -1;
|
oggpad->keyframe_granule = -1;
|
||||||
|
|
||||||
|
if (GST_STATE (ogg_mux) > GST_STATE_READY) {
|
||||||
|
/* This will be initialized in init_collectpads when going from ready
|
||||||
|
* paused state */
|
||||||
|
ogg_stream_init (&oggpad->map.stream, oggpad->map.serialno);
|
||||||
|
oggpad->pagebuffers = g_queue_new ();
|
||||||
|
}
|
||||||
|
|
||||||
gst_segment_init (&oggpad->segment, GST_FORMAT_TIME);
|
gst_segment_init (&oggpad->segment, GST_FORMAT_TIME);
|
||||||
|
|
||||||
oggpad->collect_event = (GstPadEventFunction) GST_PAD_EVENTFUNC (newpad);
|
oggpad->collect_event = (GstPadEventFunction) GST_PAD_EVENTFUNC (newpad);
|
||||||
|
|
Loading…
Reference in a new issue