summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--gst/mpegvideoparse/mpegvideoparse.c11
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bb0a9614..f0ed6363 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-02-12 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * gst/mpegvideoparse/mpegvideoparse.c:
+ (mpegvideoparse_handle_sequence), (mpegvideoparse_drain_avail),
+ (gst_mpegvideoparse_change_state):
+ Fix leaking caps.
+ Fix potential buffer leak in forward mode.
+ Cleanup queues when going to READY. Fixes #515815.
+
2008-02-12 Sebastian Dröge <slomo@circular-chaos.org>
* docs/plugins/gst-plugins-bad-plugins-docs.sgml:
diff --git a/gst/mpegvideoparse/mpegvideoparse.c b/gst/mpegvideoparse/mpegvideoparse.c
index 22859d90..97146faa 100644
--- a/gst/mpegvideoparse/mpegvideoparse.c
+++ b/gst/mpegvideoparse/mpegvideoparse.c
@@ -231,8 +231,11 @@ mpegvideoparse_handle_sequence (MpegVideoParse * mpegvideoparse,
"codec_data", GST_TYPE_BUFFER, seq_buf, NULL);
GST_DEBUG ("New mpegvideoparse caps: %" GST_PTR_FORMAT, caps);
- if (!gst_pad_set_caps (mpegvideoparse->srcpad, caps))
+ if (!gst_pad_set_caps (mpegvideoparse->srcpad, caps)) {
+ gst_caps_unref (caps);
return FALSE;
+ }
+ gst_caps_unref (caps);
/* And update the new_hdr into our stored version */
mpegvideoparse->seq_hdr = new_hdr;
@@ -372,12 +375,15 @@ mpegvideoparse_drain_avail (MpegVideoParse * mpegvideoparse)
mpegvideoparse->need_discont = FALSE;
}
res = gst_pad_push (mpegvideoparse->srcpad, buf);
+ buf = NULL;
}
/* Advance to the next data block */
mpeg_packetiser_next_block (&mpegvideoparse->packer);
cur = mpeg_packetiser_get_block (&mpegvideoparse->packer, &buf);
- };
+ }
+ if (buf != NULL)
+ gst_buffer_unref (buf);
return res;
}
@@ -824,6 +830,7 @@ gst_mpegvideoparse_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
mpv_parse_reset (mpegvideoparse);
+ gst_mpegvideoparse_flush (mpegvideoparse);
break;
default:
break;