basesink: move left over handling of the error case to the activate_failed label.
authorStefan Kost <ensonic@users.sf.net>
Thu, 26 Feb 2009 13:40:26 +0000 (15:40 +0200)
committerStefan Kost <ensonic@users.sf.net>
Thu, 26 Feb 2009 13:42:06 +0000 (15:42 +0200)
If was left as dead code.

libs/gst/base/gstbasesink.c

index e248399..532ec34 100644 (file)
@@ -3520,9 +3520,6 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
     if (!result)
       goto activate_failed;
 
-    /* but if starting the thread fails, set it back */
-    if (!result)
-      basesink->pad_mode = GST_ACTIVATE_NONE;
   } else {
     if (G_UNLIKELY (basesink->pad_mode != GST_ACTIVATE_PULL)) {
       g_warning ("Internal GStreamer activation error!!!");
@@ -3545,6 +3542,9 @@ gst_base_sink_pad_activate_pull (GstPad * pad, gboolean active)
   /* ERRORS */
 activate_failed:
   {
+    /* reset, as starting the thread failed */
+    basesink->pad_mode = GST_ACTIVATE_NONE;
+
     GST_ERROR_OBJECT (basesink, "subclass failed to activate in pull mode");
     return FALSE;
   }