Commit 66148a77 authored by Stefan Sauer's avatar Stefan Sauer

adder: ensure the discont flag is correct

Previously it happened that reused buffer caused the discont to be on the wrong
buffers.
parent d5fbc905
...@@ -1090,6 +1090,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data) ...@@ -1090,6 +1090,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
gint rate, bps, bpf; gint rate, bps, bpf;
gboolean had_mute = FALSE; gboolean had_mute = FALSE;
gboolean is_eos = TRUE; gboolean is_eos = TRUE;
gboolean is_discont = FALSE;
adder = GST_ADDER (user_data); adder = GST_ADDER (user_data);
...@@ -1169,6 +1170,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data) ...@@ -1169,6 +1170,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
"start:%" G_GINT64_FORMAT " end:%" G_GINT64_FORMAT " failed", "start:%" G_GINT64_FORMAT " end:%" G_GINT64_FORMAT " failed",
adder->segment.start, adder->segment.stop); adder->segment.start, adder->segment.stop);
} }
is_discont = TRUE;
} }
/* get available bytes for reading, this can be 0 which could mean empty /* get available bytes for reading, this can be 0 which could mean empty
...@@ -1459,6 +1461,11 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data) ...@@ -1459,6 +1461,11 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
GST_BUFFER_OFFSET_END (outbuf) = adder->offset; GST_BUFFER_OFFSET_END (outbuf) = adder->offset;
GST_BUFFER_DURATION (outbuf) = adder->segment.position - next_timestamp; GST_BUFFER_DURATION (outbuf) = adder->segment.position - next_timestamp;
} }
if (is_discont) {
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
} else {
GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_DISCONT);
}
adder->offset = next_offset; adder->offset = next_offset;
adder->segment.position = next_timestamp; adder->segment.position = next_timestamp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment