From 5fe85915bedbbdee80cbc61cd18b76c3fc4bb5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 15 Mar 2010 11:54:02 +0100 Subject: [PATCH] imagefreeze: Only start the task after a seek if a buffer was received already --- gst/imagefreeze/gstimagefreeze.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/imagefreeze/gstimagefreeze.c b/gst/imagefreeze/gstimagefreeze.c index 633ce9bae3..016be6d3d4 100644 --- a/gst/imagefreeze/gstimagefreeze.c +++ b/gst/imagefreeze/gstimagefreeze.c @@ -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,8 +624,9 @@ gst_image_freeze_src_event (GstPad * pad, GstEvent * event) GST_DEBUG_OBJECT (pad, "Seek successful"); - gst_pad_start_task (self->srcpad, - (GstTaskFunction) gst_image_freeze_src_loop, self->srcpad); + if (start_task) + gst_pad_start_task (self->srcpad, + (GstTaskFunction) gst_image_freeze_src_loop, self->srcpad); ret = TRUE; break; }