Revert "imagefreeze: Remove impossible error condition"
authorLuis de Bethencourt <luis@debethencourt.com>
Tue, 7 Jul 2015 14:54:41 +0000 (15:54 +0100)
committerLuis de Bethencourt <luis@debethencourt.com>
Tue, 7 Jul 2015 14:57:19 +0000 (15:57 +0100)
This reverts commit d46631c5c7312ad613397f8238c7a9714ae3ae94.

pad only handle EOS events but not EOS flow, and will push the buffer again
resulting in an assertion error. So we should not handle the buffer
and return EOS flow.

gst/imagefreeze/gstimagefreeze.c

index 43d4954..3c617ce 100644 (file)
@@ -676,9 +676,14 @@ gst_image_freeze_sink_chain (GstPad * pad, GstObject * parent,
 {
   GstImageFreeze *self = GST_IMAGE_FREEZE (parent);
 
-  g_return_val_if_fail (self->buffer == NULL, GST_FLOW_ERROR);
-
   g_mutex_lock (&self->lock);
+  if (self->buffer) {
+    GST_DEBUG_OBJECT (pad, "Already have a buffer, dropping");
+    gst_buffer_unref (buffer);
+    g_mutex_unlock (&self->lock);
+    return GST_FLOW_EOS;
+  }
+
   self->buffer = buffer;
 
   gst_pad_start_task (self->srcpad, (GstTaskFunction) gst_image_freeze_src_loop,