baseparse: Make sure DISCONT flags are properly propagated

If we drop a frame that contained a discontinuity, we must remember
that for the next frame that *will* be pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=766795
This commit is contained in:
Edward Hervey 2016-05-22 13:10:06 +02:00 committed by Edward Hervey
parent 56b9290073
commit ea395c2498

View file

@ -2202,6 +2202,12 @@ gst_base_parse_handle_buffer (GstBaseParse * parse, GstBuffer * buffer,
gst_adapter_clear (parse->priv->adapter);
}
if (*skip == 0 && *flushed == 0) {
/* Carry over discont if we need more data */
if (GST_BUFFER_IS_DISCONT (frame->buffer))
parse->priv->discont = TRUE;
}
gst_base_parse_frame_free (frame);
return ret;
@ -2503,6 +2509,8 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
if (ret == GST_BASE_PARSE_FLOW_DROPPED) {
GST_LOG_OBJECT (parse, "frame (%" G_GSIZE_FORMAT " bytes) dropped", size);
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT))
parse->priv->discont = TRUE;
gst_buffer_unref (buffer);
ret = GST_FLOW_OK;
} else if (ret == GST_FLOW_OK) {