summaryrefslogtreecommitdiffstats
path: root/gst/mpegvideoparse
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-02-12 10:57:27 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-02-12 10:57:27 +0000
commitb5708310bbd53c8d1bcdd87b7d0e946a4cd78b01 (patch)
treea5305d5d53d0b4d4940b5688865869250a8a3d3a /gst/mpegvideoparse
parent571a20f2053c0276b1d95f0210a3e2ad00b0177f (diff)
downloadgst-plugins-bad-b5708310bbd53c8d1bcdd87b7d0e946a4cd78b01.tar.gz
gst-plugins-bad-b5708310bbd53c8d1bcdd87b7d0e946a4cd78b01.tar.bz2
gst-plugins-bad-b5708310bbd53c8d1bcdd87b7d0e946a4cd78b01.zip
gst/mpegvideoparse/mpegvideoparse.c: Fix leaking caps.
Original commit message from CVS: * 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.
Diffstat (limited to 'gst/mpegvideoparse')
-rw-r--r--gst/mpegvideoparse/mpegvideoparse.c11
1 files changed, 9 insertions, 2 deletions
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;