imagefreeze: Only start the task after a seek if a buffer was received already

This commit is contained in:
Sebastian Dröge 2010-03-15 11:54:02 +01:00
parent 3e613f8ff4
commit 5fe85915be

View file

@ -540,6 +540,7 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
GstSeekType start_type, stop_type;
gint64 start, stop;
gint64 last_stop;
gboolean start_task;
gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
&stop_type, &stop);
@ -601,6 +602,7 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
self->need_segment = TRUE;
last_stop = self->segment.last_stop;
start_task = self->buffer != NULL;
GST_OBJECT_UNLOCK (self);
if ((flags & GST_SEEK_FLAG_FLUSH)) {
@ -622,6 +624,7 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event)
GST_DEBUG_OBJECT (pad, "Seek successful");
if (start_task)
gst_pad_start_task (self->srcpad,
(GstTaskFunction) gst_image_freeze_src_loop, self->srcpad);
ret = TRUE;