gstpad: Move sticky flag clearing code to gst_pad_activate_mode
authorJan Schmidt <thaytan@noraisin.net>
Wed, 11 Jul 2012 14:34:22 +0000 (00:34 +1000)
committerJan Schmidt <thaytan@noraisin.net>
Wed, 11 Jul 2012 14:41:23 +0000 (00:41 +1000)
The ghostpad code directly activates/deactivates the child code by
calling gst_pad_activate_mode, rather than gst_pad_set_active, so
make sure to clear the flags in gst_pad_activate_mode(), which should
catch all cases.

gst/gstpad.c

index 7a08ed3..03d6b67 100644 (file)
@@ -950,12 +950,6 @@ gst_pad_set_active (GstPad * pad, gboolean active)
   if (G_UNLIKELY (!ret))
     goto failed;
 
-  if (!active) {
-    GST_OBJECT_LOCK (pad);
-    GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_NEED_RECONFIGURE);
-    GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_EOS);
-    GST_OBJECT_UNLOCK (pad);
-  }
   return ret;
 
   /* ERRORS */
@@ -1072,6 +1066,15 @@ gst_pad_activate_mode (GstPad * pad, GstPadMode mode, gboolean active)
 
 exit_success:
   res = TRUE;
+
+  /* Clear sticky flags on deactivation */
+  if (!active) {
+    GST_OBJECT_LOCK (pad);
+    GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_NEED_RECONFIGURE);
+    GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_EOS);
+    GST_OBJECT_UNLOCK (pad);
+  }
+
 exit:
   RELEASE_PARENT (parent);