gst/gstpad.c (gst_pad_pause_task): Actually return FALSE if there is no task. Shouldn...
authorAndy Wingo <wingo@pobox.com>
Wed, 12 Oct 2005 11:49:35 +0000 (11:49 +0000)
committerAndy Wingo <wingo@pobox.com>
Wed, 12 Oct 2005 11:49:35 +0000 (11:49 +0000)
Original commit message from CVS:
2005-10-12  Andy Wingo  <wingo@pobox.com>

* gst/gstpad.c (gst_pad_pause_task): Actually return FALSE if
there is no task. Shouldn't affect any code, as nothing in our
plugins checks this return value.
(gst_pad_stop_task): Also take the stream lock if the pad has no
task. Docs updated.

ChangeLog
common
gst/gstpad.c

index 57508c0..687fdfa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-12  Andy Wingo  <wingo@pobox.com>
+
+       * gst/gstpad.c (gst_pad_pause_task): Actually return FALSE if
+       there is no task. Shouldn't affect any code, as nothing in our
+       plugins checks this return value.
+       (gst_pad_stop_task): Also take the stream lock if the pad has no
+       task. Docs updated.
+
 2005-10-12  Wim Taymans  <wim@fluendo.com>
 
        * gst/gstpad.c: (pre_activate), (post_activate),
diff --git a/common b/common
index 37ed26e..2485a65 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 37ed26e33bae9a6ab256c62ebbb9d711374a0abb
+Subproject commit 2485a65b662de25fb7b71857e34411426c6f530c
index 284fb19..8db93b5 100644 (file)
@@ -3672,8 +3672,10 @@ gst_pad_pause_task (GstPad * pad)
 
 no_task:
   {
+    GST_WARNING_OBJECT (pad,
+        "pad has no task -- very likely a programming error");
     GST_UNLOCK (pad);
-    return TRUE;
+    return FALSE;
   }
 }
 
@@ -3688,8 +3690,10 @@ no_task:
  * This function will deadlock if called from the GstTaskFunction of
  * the task. Use #gst_task_pause() instead.
  *
- * Returns: a TRUE if the task could be stopped or FALSE when the pad
- * has no task.
+ * Regardless of whether the pad has a task, the stream lock is acquired and
+ * released so as to ensure that streaming through this pad has finished.
+ *
+ * Returns: a TRUE if the task could be stopped or FALSE on error.
  */
 gboolean
 gst_pad_stop_task (GstPad * pad)
@@ -3718,6 +3722,10 @@ gst_pad_stop_task (GstPad * pad)
 no_task:
   {
     GST_UNLOCK (pad);
+
+    GST_STREAM_LOCK (pad);
+    GST_STREAM_UNLOCK (pad);
+
     return TRUE;
   }
 }