gst-inspect: fix unused-const-variable error in windows
[platform/upstream/gstreamer.git] / gst / gstpadtemplate.c
index 1df8e07..952f07e 100644 (file)
@@ -279,7 +279,7 @@ name_is_valid (const gchar * name, GstPadPresence presence)
       underscore = strchr (str, '_');
       str = strchr (str + 1, '%');
 
-      if (str && (!underscore || (underscore && str < underscore))) {
+      if (str && (!underscore || str < underscore)) {
         g_warning
             ("invalid name template %s: each of conversion specifications "
             "must be separated by an underscore", name);
@@ -331,7 +331,7 @@ gst_static_pad_template_get (GstStaticPadTemplate * pad_template)
  *
  * Converts a #GstStaticPadTemplate into a #GstPadTemplate with a type.
  *
- * Returns: (transfer floating): a new #GstPadTemplate.
+ * Returns: (transfer floating) (nullable): a new #GstPadTemplate.
  *
  * Since: 1.14
  */
@@ -342,6 +342,8 @@ gst_pad_template_new_from_static_pad_template_with_gtype (GstStaticPadTemplate *
   GstPadTemplate *new;
   GstCaps *caps;
 
+  g_return_val_if_fail (g_type_is_a (pad_type, GST_TYPE_PAD), NULL);
+
   if (!name_is_valid (pad_template->name_template, pad_template->presence))
     return NULL;
 
@@ -406,7 +408,7 @@ gst_pad_template_new (const gchar * name_template,
  * Creates a new pad template with a name according to the given template
  * and with the given arguments.
  *
- * Returns: (transfer floating): a new #GstPadTemplate.
+ * Returns: (transfer floating) (nullable): a new #GstPadTemplate.
  *
  * Since: 1.14
  */
@@ -423,6 +425,7 @@ gst_pad_template_new_with_gtype (const gchar * name_template,
       || direction == GST_PAD_SINK, NULL);
   g_return_val_if_fail (presence == GST_PAD_ALWAYS
       || presence == GST_PAD_SOMETIMES || presence == GST_PAD_REQUEST, NULL);
+  g_return_val_if_fail (g_type_is_a (pad_type, GST_TYPE_PAD), NULL);
 
   if (!name_is_valid (name_template, presence)) {
     return NULL;