imagefreeze: Send close segments when seeking only for non-flushing seeks and if we already sent a newsegment event

Fixes bug #626619.
This commit is contained in:
Sebastian Dröge 2010-08-11 22:20:25 +02:00
parent 3bdc5c248e
commit 90f273b165

View file

@ -541,11 +541,14 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
gint64 start, stop;
gint64 last_stop;
gboolean start_task;
gboolean flush;
gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
&stop_type, &stop);
gst_event_unref (event);
flush = ! !(flags & GST_SEEK_FLAG_FLUSH);
if (format != GST_FORMAT_TIME && format != GST_FORMAT_DEFAULT) {
GST_ERROR_OBJECT (pad, "Seek in invalid format: %s",
gst_format_get_name (format));
@ -567,7 +570,7 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
}
}
if ((flags & GST_SEEK_FLAG_FLUSH)) {
if (flush) {
GstEvent *e;
e = gst_event_new_flush_start ();
@ -580,12 +583,13 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
GST_OBJECT_LOCK (self);
gst_event_replace (&self->close_segment, NULL);
if (self->segment.rate >= 0) {
if (!flush) {
if (!self->need_segment && self->segment.rate >= 0) {
self->close_segment =
gst_event_new_new_segment_full (TRUE, self->segment.rate,
self->segment.applied_rate, self->segment.format,
self->segment.start, self->segment.last_stop, self->segment.time);
} else {
} else if (!self->need_segment) {
gint64 stop;
if ((stop = self->segment.stop) == -1)
@ -596,6 +600,7 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
self->segment.applied_rate, self->segment.format,
self->segment.last_stop, stop, self->segment.last_stop);
}
}
gst_segment_set_seek (&self->segment, rate, format, flags, start_type,
start, stop_type, stop, NULL);
@ -605,7 +610,7 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
start_task = self->buffer != NULL;
GST_OBJECT_UNLOCK (self);
if ((flags & GST_SEEK_FLAG_FLUSH)) {
if (flush) {
GstEvent *e;
e = gst_event_new_flush_stop ();