basesrc: move the quick return up
authorStefan Sauer <ensonic@users.sf.net>
Thu, 25 Sep 2014 18:23:31 +0000 (20:23 +0200)
committerStefan Sauer <ensonic@users.sf.net>
Thu, 25 Sep 2014 18:33:17 +0000 (20:33 +0200)
Don't assign local vars if we skip anyway. Add logging for failure conditio

libs/gst/base/gstbasesrc.c

index 071a109..7f4a13a 100644 (file)
@@ -2310,20 +2310,18 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length,
 {
   guint64 size, maxsize;
   GstBaseSrcClass *bclass;
-  GstFormat format;
   gint64 stop;
 
+  /* only operate if we are working with bytes */
+  if (src->segment.format != GST_FORMAT_BYTES)
+    return TRUE;
+
   bclass = GST_BASE_SRC_GET_CLASS (src);
 
-  format = src->segment.format;
   stop = src->segment.stop;
   /* get total file size */
   size = src->segment.duration;
 
-  /* only operate if we are working with bytes */
-  if (format != GST_FORMAT_BYTES)
-    return TRUE;
-
   /* when not doing automatic EOS, just use the stop position. We don't use
    * the size to check for EOS */
   if (!g_atomic_int_get (&src->priv->automatic_eos))
@@ -2379,6 +2377,7 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length,
   /* ERRORS */
 unexpected_length:
   {
+    GST_WARNING_OBJECT (src, "processing at or past EOS");
     return FALSE;
   }
 }