summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2004-06-10 11:33:05 +0000
committerWim Taymans <wim.taymans@gmail.com>2004-06-10 11:33:05 +0000
commit86cbbbae2313fbe84e833d64a7f9f0ff94c712b9 (patch)
treea06b488790803a8a5679b382c864e68309a20c0e
parent01f49018b6d76aa6106665dc0bd9dcf6d571037b (diff)
ext/: Fix refcounting bugs
Original commit message from CVS: * ext/ogg/gstoggmux.c: (gst_ogg_mux_next_buffer), (gst_ogg_mux_get_headers), (gst_ogg_mux_set_header_on_caps), (gst_ogg_mux_send_headers), (gst_ogg_mux_loop): * ext/theora/theoraenc.c: (theora_enc_chain): Fix refcounting bugs
-rw-r--r--ChangeLog8
-rw-r--r--ext/ogg/gstoggmux.c12
-rw-r--r--ext/theora/theoraenc.c4
3 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index d4d3979fe..d7c1fadb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-06-10 Wim Taymans <wim@fluendo.com>
+
+ * ext/ogg/gstoggmux.c: (gst_ogg_mux_next_buffer),
+ (gst_ogg_mux_get_headers), (gst_ogg_mux_set_header_on_caps),
+ (gst_ogg_mux_send_headers), (gst_ogg_mux_loop):
+ * ext/theora/theoraenc.c: (theora_enc_chain):
+ Fix refcounting bugs
+
2004-06-10 Ronald Bultje <rbultje@ronald.bitfreak.net>
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_init),
diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c
index ba5d16b9b..6d1cdf82b 100644
--- a/ext/ogg/gstoggmux.c
+++ b/ext/ogg/gstoggmux.c
@@ -377,8 +377,8 @@ gst_ogg_mux_next_buffer (GstOggPad * pad)
GstData *data = NULL;
while (data == NULL) {
- GST_LOG ("muxer: pulling %s:%s", GST_DEBUG_PAD_NAME (pad->pad));
data = gst_pad_pull (pad->pad);
+ GST_DEBUG ("muxer: pulled %s:%s %p", GST_DEBUG_PAD_NAME (pad->pad), data);
/* if it's an event, handle it */
if (GST_IS_EVENT (data)) {
GstEventType type;
@@ -409,12 +409,12 @@ gst_ogg_mux_next_buffer (GstOggPad * pad)
if (pad->state == GST_OGG_PAD_STATE_CONTROL) {
/* and we have one */
if (incaps) {
- GST_LOG ("muxer: got incaps buffer in control state, ignoring");
+ GST_DEBUG ("muxer: got incaps buffer in control state, ignoring");
/* just ignore */
gst_buffer_unref (buf);
data = NULL;
} else {
- GST_LOG
+ GST_DEBUG
("muxer: got data buffer in control state, switching to data mode");
/* this is a data buffer so switch to data state */
pad->state = GST_OGG_PAD_STATE_DATA;
@@ -568,6 +568,7 @@ gst_ogg_mux_get_headers (GstOggPad * pad)
if (G_VALUE_TYPE (bufval) == GST_TYPE_BUFFER) {
GstBuffer *buf = g_value_peek_pointer (bufval);
+ gst_buffer_ref (buf);
res = g_list_append (res, buf);
}
}
@@ -739,6 +740,8 @@ gst_ogg_mux_send_headers (GstOggMux * mux)
}
}
}
+ g_list_free (pad->headers);
+ pad->headers = NULL;
}
/* hbufs holds all buffers for the headers now */
@@ -757,8 +760,11 @@ gst_ogg_mux_send_headers (GstOggMux * mux)
if (GST_PAD_IS_USABLE (mux->srcpad)) {
gst_pad_push (mux->srcpad, GST_DATA (buf));
+ } else {
+ gst_buffer_unref (buf);
}
}
+ g_list_free (hbufs);
}
/* basic idea:
diff --git a/ext/theora/theoraenc.c b/ext/theora/theoraenc.c
index bce58fde4..ea207c6c4 100644
--- a/ext/theora/theoraenc.c
+++ b/ext/theora/theoraenc.c
@@ -334,9 +334,6 @@ theora_enc_chain (GstPad * pad, GstData * data)
theora_encode_tables (&enc->state, &op);
buf3 = theora_buffer_from_packet (enc, &op);
- /* create caps */
- caps = gst_caps_new_simple ("video/x-theora", NULL);
-
/* mark buffers and put on caps */
caps = gst_pad_get_caps (enc->srcpad);
theora_set_header_on_caps (caps, buf1, buf2, buf3);
@@ -348,7 +345,6 @@ theora_enc_chain (GstPad * pad, GstData * data)
gst_data_unref (data);
return;
}
- gst_caps_free (caps);
/* push out the header buffers */
theora_push_buffer (enc, buf1);