From ef56ebad488d7b4a7610ab733d1cec626a2f5d91 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 19 May 2009 16:45:56 +0300 Subject: [PATCH] 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. --- gst/adder/gstadder.c | 7 +++++++ gst/adder/gstadder.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 2905d3f..0861997 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -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; diff --git a/gst/adder/gstadder.h b/gst/adder/gstadder.h index 62075c0..d656e9d 100644 --- a/gst/adder/gstadder.h +++ b/gst/adder/gstadder.h @@ -87,6 +87,8 @@ struct _GstAdder { gboolean segment_pending; guint64 segment_position; gdouble segment_rate; + /* src event handling */ + gboolean flush_stop_pending; }; struct _GstAdderClass { -- 2.7.4