summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-07-28 17:25:10 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-07-28 17:25:34 +0200
commit8b80d60648332124a5d648abd5ae3a4683274ac9 (patch)
tree949397eee3abc892984a9e431d2bbcf9ef6657f8
parentbd386a2785aa31d64441bb89e0d136765ed5c3bc (diff)
downloadgstreamer-plugins-bad-8b80d60648332124a5d648abd5ae3a4683274ac9.tar.gz
uvch264_mjpgdemux: Don't unmap/unref buffer if it's pushed out as-is
-rw-r--r--sys/uvch264/gstuvch264_mjpgdemux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/uvch264/gstuvch264_mjpgdemux.c b/sys/uvch264/gstuvch264_mjpgdemux.c
index cb2ea2be1..431ba98ce 100644
--- a/sys/uvch264/gstuvch264_mjpgdemux.c
+++ b/sys/uvch264/gstuvch264_mjpgdemux.c
@@ -462,8 +462,7 @@ gst_uvc_h264_mjpg_demux_chain (GstPad * pad,
{
GstUvcH264MjpgDemux *self;
GstFlowReturn ret = GST_FLOW_OK;
- GstBuffer *jpeg_buf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_METADATA,
- 0, 0);
+ GstBuffer *jpeg_buf = NULL;
GstBuffer *aux_buf = NULL;
AuxiliaryStreamHeader aux_header = { 0 };
guint32 aux_size = 0;
@@ -480,12 +479,13 @@ gst_uvc_h264_mjpg_demux_chain (GstPad * pad,
last_offset = 0;
size = gst_buffer_get_size (buf);
if (size == 0) {
- ret = gst_pad_push (self->priv->jpeg_pad, buf);
- goto done;
+ return gst_pad_push (self->priv->jpeg_pad, buf);
}
gst_buffer_map (buf, &info, GST_MAP_READ);
+ jpeg_buf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_METADATA, 0, 0);
+
data = info.data;
for (i = 0; i < size - 1; i++) {