mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
baseparse: respect DISCONT flag on buffers
Drain the parser when a DISCONT buffer is received and then mark the next buffer to be pushed as a DISCONT one https://bugzilla.gnome.org/show_bug.cgi?id=745927
This commit is contained in:
parent
18b0581009
commit
8641997630
1 changed files with 8 additions and 4 deletions
|
@ -2948,13 +2948,17 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||
gst_base_parse_frame_free (&frame);
|
||||
return ret;
|
||||
}
|
||||
/* upstream feeding us in reverse playback;
|
||||
* finish previous fragment and start new upon DISCONT */
|
||||
if (parse->segment.rate < 0.0) {
|
||||
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT))) {
|
||||
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT))) {
|
||||
/* upstream feeding us in reverse playback;
|
||||
* finish previous fragment and start new upon DISCONT */
|
||||
if (parse->segment.rate < 0.0) {
|
||||
GST_DEBUG_OBJECT (parse, "buffer starts new reverse playback fragment");
|
||||
ret = gst_base_parse_finish_fragment (parse, TRUE);
|
||||
gst_base_parse_start_fragment (parse);
|
||||
} else {
|
||||
/* discont in the stream, drain and mark discont for next output */
|
||||
gst_base_parse_drain (parse);
|
||||
parse->priv->discont = TRUE;
|
||||
}
|
||||
}
|
||||
gst_adapter_push (parse->priv->adapter, buffer);
|
||||
|
|
Loading…
Reference in a new issue