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:
Stefan Kost 2009-05-19 16:45:56 +03:00
parent a3670c67fa
commit ef56ebad48
2 changed files with 9 additions and 0 deletions

View file

@ -672,6 +672,8 @@ gst_adder_src_event (GstPad * pad, GstEvent * event)
else else
adder->segment_position = 0; adder->segment_position = 0;
adder->segment_pending = TRUE; adder->segment_pending = TRUE;
adder->flush_stop_pending =
((flags & GST_SEEK_FLAG_FLUSH) == GST_SEEK_FLAG_FLUSH);
GST_OBJECT_UNLOCK (adder->collect); GST_OBJECT_UNLOCK (adder->collect);
GST_DEBUG_OBJECT (adder, "forwarding seek event: %" GST_PTR_FORMAT, GST_DEBUG_OBJECT (adder, "forwarding seek event: %" GST_PTR_FORMAT,
event); event);
@ -719,6 +721,7 @@ gst_adder_sink_event (GstPad * pad, GstEvent * event)
* and downstream (using our source pad, the bastard!). * and downstream (using our source pad, the bastard!).
*/ */
adder->segment_pending = TRUE; adder->segment_pending = TRUE;
adder->flush_stop_pending = FALSE;
break; break;
default: default:
break; break;
@ -1006,6 +1009,10 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
adder->timestamp, adder->segment_position); 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 */ /* set timestamps on the output buffer */
GST_BUFFER_TIMESTAMP (outbuf) = adder->timestamp; GST_BUFFER_TIMESTAMP (outbuf) = adder->timestamp;

View file

@ -87,6 +87,8 @@ struct _GstAdder {
gboolean segment_pending; gboolean segment_pending;
guint64 segment_position; guint64 segment_position;
gdouble segment_rate; gdouble segment_rate;
/* src event handling */
gboolean flush_stop_pending;
}; };
struct _GstAdderClass { struct _GstAdderClass {