]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/commitdiff
libs/gst/base/gstbasesrc.c: Handle errors from the clock sync better, only UNSCHEDULE...
authorWim Taymans <wim.taymans@gmail.com>
Thu, 22 Mar 2007 11:19:32 +0000 (11:19 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 22 Mar 2007 11:19:32 +0000 (11:19 +0000)
Original commit message from CVS:
* libs/gst/base/gstbasesrc.c: (gst_base_src_get_range):
Handle errors from the clock sync better, only UNSCHEDULED indicates a
WRONG_STATE and can silently pause the task. All other cases should
error out.

ChangeLog
libs/gst/base/gstbasesrc.c

index 75c9e832cfb5877a8eb607f642efeceb380595e4..65f0038f2de97436b7e1a32e3b689b09a79af9b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-22  Wim Taymans  <wim@fluendo.com>
+
+       * libs/gst/base/gstbasesrc.c: (gst_base_src_get_range):
+       Handle errors from the clock sync better, only UNSCHEDULED indicates a
+       WRONG_STATE and can silently pause the task. All other cases should
+       error out.
+
 2007-03-22  Wim Taymans  <wim@fluendo.com>
 
        Patch by: <syrjala at sci dot fi>
index cbb0d073ffe5cff8b8d0da2b528c5a63125e9fa2..e5fb626c9fdd6469f038ad9cb1febc20349ddb79 100644 (file)
@@ -1400,21 +1400,33 @@ gst_base_src_get_range (GstBaseSrc * src, guint64 offset, guint length,
   status = gst_base_src_do_sync (src, *buf);
   switch (status) {
     case GST_CLOCK_EARLY:
+      /* the buffer is too late. We currently don't drop the buffer. */
       GST_DEBUG_OBJECT (src, "buffer too late!, returning anyway");
       break;
     case GST_CLOCK_OK:
+      /* buffer synchronised properly */
       GST_DEBUG_OBJECT (src, "buffer ok");
       break;
-    default:
+    case GST_CLOCK_UNSCHEDULED:
       /* this case is triggered when we were waiting for the clock and
        * it got unlocked because we did a state change. We return 
        * WRONG_STATE in this case to stop the dataflow also get rid of the
        * produced buffer. */
-      GST_DEBUG_OBJECT (src, "clock returned %d, not returning", status);
+      GST_DEBUG_OBJECT (src,
+          "clock was unscheduled (%d), returning WRONG_STATE", status);
       gst_buffer_unref (*buf);
       *buf = NULL;
       ret = GST_FLOW_WRONG_STATE;
       break;
+    default:
+      /* all other result values are unexpected and errors */
+      GST_ELEMENT_ERROR (src, CORE, CLOCK,
+          (_("Internal clock error.")),
+          ("clock returned unexpected return value %d", status));
+      gst_buffer_unref (*buf);
+      *buf = NULL;
+      ret = GST_FLOW_ERROR;
+      break;
   }
 done:
   return ret;