From: Thiago Santos Date: Mon, 16 Jun 2014 22:30:06 +0000 (-0300) Subject: baseparse: avoid returning _OK for _NOT_LINKED X-Git-Tag: 1.3.90~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7516dbf7cfc0321f7ec918bfaf27dcbd49fd130;p=platform%2Fupstream%2Fgstreamer.git baseparse: avoid returning _OK for _NOT_LINKED When the parser receives non-aligned packets it can push a buffer and get a not-linked return while still leaving some data still to be parsed. This remaining data will not form a complete frame and the subclass likely returns _OK and baseparse would take that as the return, while it the element is actually not-linked. This patch fixes this by storing the last flow-return from a push and using that if a parsing operation doesn't result in data being flushed or skipped. https://bugzilla.gnome.org/show_bug.cgi?id=731474 --- diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index c3e63e1..fb31c9e 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -2716,6 +2716,7 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) GstBaseParseClass *bclass; GstBaseParse *parse; GstFlowReturn ret = GST_FLOW_OK; + GstFlowReturn old_ret = GST_FLOW_OK; GstBuffer *tmpbuf = NULL; guint fsize = 1; gint skip = -1; @@ -2902,8 +2903,11 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) if (skip == 0 && flush == 0) { GST_LOG_OBJECT (parse, "nothing skipped and no frames finished, " "breaking to get more data"); + /* ignore this return as it produced no data */ + ret = old_ret; goto done; } + old_ret = ret; } done: