imagefreeze: Remove impossible error condition
authorVineeth T M <vineeth.tm@samsung.com>
Thu, 28 Aug 2014 10:43:29 +0000 (16:13 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 28 Aug 2014 11:55:00 +0000 (14:55 +0300)
We return EOS after the first buffer, and GstPad will make sure now that we
won't get any other buffer afterwards until a flush happens. No need to check
for it ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=735581

gst/imagefreeze/gstimagefreeze.c

index 9b13c14..9395db9 100644 (file)
@@ -669,14 +669,9 @@ gst_image_freeze_sink_chain (GstPad * pad, GstObject * parent,
 {
   GstImageFreeze *self = GST_IMAGE_FREEZE (parent);
 
-  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;
-  }
+  g_return_val_if_fail (self->buffer == NULL, GST_FLOW_ERROR);
 
+  g_mutex_lock (&self->lock);
   self->buffer = buffer;
 
   gst_pad_start_task (self->srcpad, (GstTaskFunction) gst_image_freeze_src_loop,