mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
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
This commit is contained in:
parent
8b9a8e4fb0
commit
8528026c3b
1 changed files with 4 additions and 0 deletions
|
@ -2706,6 +2706,7 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||||
GstBaseParseClass *bclass;
|
GstBaseParseClass *bclass;
|
||||||
GstBaseParse *parse;
|
GstBaseParse *parse;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
GstFlowReturn old_ret = GST_FLOW_OK;
|
||||||
GstBuffer *tmpbuf = NULL;
|
GstBuffer *tmpbuf = NULL;
|
||||||
guint fsize = 1;
|
guint fsize = 1;
|
||||||
gint skip = -1;
|
gint skip = -1;
|
||||||
|
@ -2892,8 +2893,11 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||||
if (skip == 0 && flush == 0) {
|
if (skip == 0 && flush == 0) {
|
||||||
GST_LOG_OBJECT (parse, "nothing skipped and no frames finished, "
|
GST_LOG_OBJECT (parse, "nothing skipped and no frames finished, "
|
||||||
"breaking to get more data");
|
"breaking to get more data");
|
||||||
|
/* ignore this return as it produced no data */
|
||||||
|
ret = old_ret;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
old_ret = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in a new issue