mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
ext/ogg/gstoggmux.c: Fix an ugly memleak where the muxer didn't flush enough ogg pages. This also resulted in badly m...
Original commit message from CVS: * ext/ogg/gstoggmux.c: (gst_ogg_mux_get_type), (gst_ogg_mux_init), (gst_ogg_mux_sinkconnect), (gst_ogg_mux_request_new_pad), (gst_ogg_mux_next_buffer), (gst_ogg_mux_push_page), (gst_ogg_mux_compare_pads), (gst_ogg_mux_queue_pads), (gst_ogg_mux_loop): Fix an ugly memleak where the muxer didn't flush enough ogg pages. This also resulted in badly muxed ogg files.
This commit is contained in:
parent
754cf8b99b
commit
db9cdcef0f
2 changed files with 18 additions and 7 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-05-18 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* ext/ogg/gstoggmux.c: (gst_ogg_mux_get_type), (gst_ogg_mux_init),
|
||||||
|
(gst_ogg_mux_sinkconnect), (gst_ogg_mux_request_new_pad),
|
||||||
|
(gst_ogg_mux_next_buffer), (gst_ogg_mux_push_page),
|
||||||
|
(gst_ogg_mux_compare_pads), (gst_ogg_mux_queue_pads),
|
||||||
|
(gst_ogg_mux_loop):
|
||||||
|
Fix an ugly memleak where the muxer didn't flush enough ogg
|
||||||
|
pages. This also resulted in badly muxed ogg files.
|
||||||
|
|
||||||
2004-05-18 Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
|
2004-05-18 Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
|
||||||
|
|
||||||
* gst/asfdemux/asfheaders.c :
|
* gst/asfdemux/asfheaders.c :
|
||||||
|
|
|
@ -384,6 +384,7 @@ gst_ogg_mux_next_buffer (GstOggPad * pad)
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
|
gst_event_unref (event);
|
||||||
return NULL;
|
return NULL;
|
||||||
default:
|
default:
|
||||||
gst_pad_event_default (pad->pad, event);
|
gst_pad_event_default (pad->pad, event);
|
||||||
|
@ -415,8 +416,9 @@ gst_ogg_mux_push_page (GstOggMux * mux, ogg_page * page)
|
||||||
|
|
||||||
if (GST_PAD_IS_USABLE (mux->srcpad))
|
if (GST_PAD_IS_USABLE (mux->srcpad))
|
||||||
gst_pad_push (mux->srcpad, GST_DATA (buffer));
|
gst_pad_push (mux->srcpad, GST_DATA (buffer));
|
||||||
else
|
else {
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -543,14 +545,13 @@ gst_ogg_mux_loop (GstElement * element)
|
||||||
ogg_page page;
|
ogg_page page;
|
||||||
GstBuffer *buf, *tmpbuf;
|
GstBuffer *buf, *tmpbuf;
|
||||||
GstOggPad *pad = ogg_mux->pulling;
|
GstOggPad *pad = ogg_mux->pulling;
|
||||||
gint ret;
|
|
||||||
GstOggPadState newstate;
|
GstOggPadState newstate;
|
||||||
|
|
||||||
/* now see if we have a buffer */
|
/* now see if we have a buffer */
|
||||||
buf = pad->buffer;
|
buf = pad->buffer;
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
/* no buffer, get one */
|
/* no buffer, get one, and store in the pad so we free it later on */
|
||||||
buf = gst_ogg_mux_next_buffer (pad);
|
buf = pad->buffer = gst_ogg_mux_next_buffer (pad);
|
||||||
/* data exhausted on this pad (EOS) */
|
/* data exhausted on this pad (EOS) */
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
/* stop pulling from the pad */
|
/* stop pulling from the pad */
|
||||||
|
@ -601,9 +602,9 @@ gst_ogg_mux_loop (GstElement * element)
|
||||||
/* store new readahead buffer */
|
/* store new readahead buffer */
|
||||||
pad->buffer = tmpbuf;
|
pad->buffer = tmpbuf;
|
||||||
|
|
||||||
/* create a page */
|
/* flush out the pages now. The packet we got could end up in
|
||||||
ret = ogg_stream_pageout (&pad->stream, &page);
|
* more than one page so we need to flush them all */
|
||||||
if (ret > 0) {
|
while (ogg_stream_pageout (&pad->stream, &page) > 0) {
|
||||||
/* we have a complete page now, we can push the page
|
/* we have a complete page now, we can push the page
|
||||||
* and make sure to pull on a new pad the next time around */
|
* and make sure to pull on a new pad the next time around */
|
||||||
gst_ogg_mux_push_page (ogg_mux, &page);
|
gst_ogg_mux_push_page (ogg_mux, &page);
|
||||||
|
|
Loading…
Reference in a new issue