summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb0c51b)
raw | patch | inline | side by side (parent: bb0c51b)
author | Rob Clark <rob@ti.com> | |
Mon, 12 Dec 2011 00:02:07 +0000 (18:02 -0600) | ||
committer | Rob Clark <rob@ti.com> | |
Mon, 12 Dec 2011 02:06:50 +0000 (20:06 -0600) |
If we don't have an input frame, and unref the outbuf, and the original
buffer was replaced by a bufferpool buffer, we need to unref the new
buffer, not the original.
buffer was replaced by a bufferpool buffer, we need to unref the new
buffer, not the original.
src/gstducatibufferpool.c | patch | blob | history | |
src/gstducatividdec.c | patch | blob | history |
index 3ca57c70d6713b99f76b6a89e4a0fbf7fff3c63a..684b9a383f874d33925067e5f364e1b36d389a95 100644 (file)
GST_LOG_OBJECT (pool->element, "finalizing buffer %p", self);
+ if (self->orig)
+ gst_buffer_unref (self->orig);
+
GST_DUCATI_BUFFERPOOL_LOCK (pool);
if (pool->running) {
resuscitated = TRUE;
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index 06842a95cb805f25b3d63ea8a5c242710b462d3b..251468d7e0839fd111949beec97e58904994dc6f 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
}
static XDAS_Int32
-codec_prepare_outbuf (GstDucatiVidDec * self, GstBuffer * buf)
+codec_prepare_outbuf (GstDucatiVidDec * self, GstBuffer ** buf)
{
XDAS_Int16 y_type, uv_type;
guint8 *y_vaddr, *uv_vaddr;
SSPtr y_paddr, uv_paddr;
- y_vaddr = GST_BUFFER_DATA (buf);
+ y_vaddr = GST_BUFFER_DATA (*buf);
uv_vaddr = y_vaddr + self->stride * self->padded_height;
y_paddr = TilerMem_VirtToPhys (y_vaddr);
if (y_type < 0 || uv_type < 0) {
GST_DEBUG_OBJECT (self, "non TILER buffer, fallback to bufferpool");
- return codec_prepare_outbuf (self, codec_bufferpool_get (self, buf));
+ *buf = codec_bufferpool_get (self, *buf);
+ return codec_prepare_outbuf (self, buf);
}
if (!self->outBufs->numBufs) {
if ((self->outBufs->descs[0].memType != y_type) ||
(self->outBufs->descs[1].memType != uv_type)) {
GST_DEBUG_OBJECT (self, "buffer mismatch, fallback to bufferpool");
- return codec_prepare_outbuf (self, codec_bufferpool_get (self, buf));
+ *buf = codec_bufferpool_get (self, *buf);
+ return codec_prepare_outbuf (self, buf);
}
}
self->outBufs->descs[0].buf = (XDAS_Int8 *) y_paddr;
self->outBufs->descs[1].buf = (XDAS_Int8 *) uv_paddr;
- return (XDAS_Int32) buf; // XXX use lookup table
+ return (XDAS_Int32) *buf; // XXX use lookup table
}
static GstBuffer *
ret = gst_pad_alloc_buffer (self->srcpad, 0, self->outsize,
GST_PAD_CAPS (self->srcpad), &outbuf);
if (ret != GST_FLOW_OK) {
- GST_DEBUG_OBJECT (self, "alloc_buffer failed %s", gst_flow_get_name (ret));
+ GST_ERROR_OBJECT (self, "alloc_buffer failed %s", gst_flow_get_name (ret));
return ret;
}
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
/* pass new output buffer as to the decoder to decode into: */
- self->inArgs->inputID = codec_prepare_outbuf (self, outbuf);
+ self->inArgs->inputID = codec_prepare_outbuf (self, &outbuf);
if (!self->inArgs->inputID) {
GST_ERROR_OBJECT (self, "could not prepare output buffer");
return GST_FLOW_ERROR;