mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
adder: send flush_stop to match flush_start
Adder was relying that something else sends a flush stop. When using adder with a livesource it was not getting a flush_stop and thus all pads downstream where keept flushing. Mark a pending flush_stop and send it when we are working on the new segment back in the streaming thread.
This commit is contained in:
parent
a3670c67fa
commit
ef56ebad48
2 changed files with 9 additions and 0 deletions
|
@ -672,6 +672,8 @@ gst_adder_src_event (GstPad * pad, GstEvent * event)
|
|||
else
|
||||
adder->segment_position = 0;
|
||||
adder->segment_pending = TRUE;
|
||||
adder->flush_stop_pending =
|
||||
((flags & GST_SEEK_FLAG_FLUSH) == GST_SEEK_FLAG_FLUSH);
|
||||
GST_OBJECT_UNLOCK (adder->collect);
|
||||
GST_DEBUG_OBJECT (adder, "forwarding seek event: %" GST_PTR_FORMAT,
|
||||
event);
|
||||
|
@ -719,6 +721,7 @@ gst_adder_sink_event (GstPad * pad, GstEvent * event)
|
|||
* and downstream (using our source pad, the bastard!).
|
||||
*/
|
||||
adder->segment_pending = TRUE;
|
||||
adder->flush_stop_pending = FALSE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1006,6 +1009,10 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
|
|||
adder->timestamp, adder->segment_position);
|
||||
}
|
||||
}
|
||||
if (adder->flush_stop_pending) {
|
||||
gst_pad_push_event (adder->srcpad, gst_event_new_flush_stop ());
|
||||
adder->flush_stop_pending = FALSE;
|
||||
}
|
||||
|
||||
/* set timestamps on the output buffer */
|
||||
GST_BUFFER_TIMESTAMP (outbuf) = adder->timestamp;
|
||||
|
|
|
@ -87,6 +87,8 @@ struct _GstAdder {
|
|||
gboolean segment_pending;
|
||||
guint64 segment_position;
|
||||
gdouble segment_rate;
|
||||
/* src event handling */
|
||||
gboolean flush_stop_pending;
|
||||
};
|
||||
|
||||
struct _GstAdderClass {
|
||||
|
|
Loading…
Reference in a new issue