dtlsenc: Don't manually activate/deactivate srcpad
authorSebastian Dröge <sebastian@centricular.com>
Wed, 18 Mar 2015 16:35:12 +0000 (17:35 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 18 Mar 2015 16:35:12 +0000 (17:35 +0100)
ext/dtls/gstdtlsenc.c

index 890217d..68949d5 100644 (file)
@@ -296,15 +296,8 @@ gst_dtls_enc_change_state (GstElement * element, GstStateChange transition)
         return GST_STATE_CHANGE_FAILURE;
       }
       break;
-    case GST_STATE_CHANGE_READY_TO_PAUSED:
-      GST_DEBUG_OBJECT (self, "starting connection %s", self->connection_id);
-      gst_dtls_connection_start (self->connection, self->is_client);
-
-      gst_pad_set_active (self->src, TRUE);
-      break;
     case GST_STATE_CHANGE_PAUSED_TO_READY:
       GST_DEBUG_OBJECT (self, "stopping connection %s", self->connection_id);
-      gst_pad_set_active (self->src, FALSE);
 
       gst_dtls_connection_stop (self->connection);
       break;
@@ -324,6 +317,15 @@ gst_dtls_enc_change_state (GstElement * element, GstStateChange transition)
 
   ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
 
+  switch (transition) {
+    case GST_STATE_CHANGE_READY_TO_PAUSED:
+      GST_DEBUG_OBJECT (self, "starting connection %s", self->connection_id);
+      gst_dtls_connection_start (self->connection, self->is_client);
+      break;
+    default:
+      break;
+  }
+
   return ret;
 }