summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c81594a)
raw | patch | inline | side by side (parent: c81594a)
author | Alessandro Decina <alessandro.decina@collabora.com> | |
Wed, 11 Apr 2012 12:04:56 +0000 (14:04 +0200) | ||
committer | Alessandro Decina <alessandro.decina@collabora.com> | |
Wed, 11 Apr 2012 12:04:56 +0000 (14:04 +0200) |
src/gstducatividdec.c | patch | blob | history |
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index 9f17a137c9ce65c8065e37e81488e4db8fb01b46..909abe78739764f357dc95d3ba4ac2672d446723 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
}
static gint
-codec_process (GstDucatiVidDec * self, gboolean send, gboolean flush)
+codec_process (GstDucatiVidDec * self, gboolean send, gboolean flush,
+ GstFlowReturn * flow_ret)
{
gint err;
GstClockTime t;
GstBuffer *outbuf = NULL;
gint i;
GstDucatiVidDecClass *klass = GST_DUCATIVIDDEC_GET_CLASS (self);
+ GstFlowReturn ret = GST_FLOW_OK;
memset (&self->outArgs->outputID, 0, sizeof (self->outArgs->outputID));
memset (&self->outArgs->freeBufID, 0, sizeof (self->outArgs->freeBufID));
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (self->srcpad));
}
- gst_pad_push (self->srcpad, outbuf);
+ ret = gst_pad_push (self->srcpad, outbuf);
+ if (flow_ret)
+ *flow_ret = ret;
+ if (ret != GST_FLOW_OK) {
+ GST_WARNING_OBJECT (self, "push failed %s", gst_flow_get_name (ret));
+ /* just unref the remaining buffers (if any) */
+ send = FALSE;
+ }
} else {
GST_DEBUG_OBJECT (self, "free buffer: %d %p", i, outbuf);
gst_buffer_unref (outbuf);
self->inArgs->inputID = 0;
do {
- err = codec_process (self, eos, TRUE);
+ err = codec_process (self, eos, TRUE, NULL);
} while (err != XDM_EFAIL);
/* reset outArgs in case we're flushing in codec_process trying to do error
ret = gst_pad_alloc_buffer (self->srcpad, 0, self->outsize,
GST_PAD_CAPS (self->srcpad), &outbuf);
if (ret != GST_FLOW_OK) {
- GST_ERROR_OBJECT (self, "alloc_buffer failed %s", gst_flow_get_name (ret));
+ GST_WARNING_OBJECT (self, "alloc_buffer failed %s",
+ gst_flow_get_name (ret));
return ret;
}
self->inArgs->numBytes = self->in_size;
self->inBufs->descs[0].bufSize.bytes = self->in_size;
- err = codec_process (self, TRUE, FALSE);
+ err = codec_process (self, TRUE, FALSE, &ret);
if (err) {
GST_ELEMENT_ERROR (self, STREAM, DECODE, (NULL),
("process returned error: %d %08x", err, self->outArgs->extendedError));
return GST_FLOW_ERROR;
}
+ if (ret != GST_FLOW_OK) {
+ GST_WARNING_OBJECT (self, "push from codec_process failed %s",
+ gst_flow_get_name (ret));
+ return ret;
+ }
self->first_in_buffer = FALSE;