encodebin: Don't set audiorate property before NULL check
authorArun Raghavan <arun@arunraghavan.net>
Thu, 8 Jun 2017 07:04:24 +0000 (12:34 +0530)
committerArun Raghavan <arun@arunraghavan.net>
Thu, 8 Jun 2017 07:04:24 +0000 (12:34 +0530)
gst/encoding/gstencodebin.c

index 9910e80..153b37d 100644 (file)
@@ -1530,11 +1530,11 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
     GST_LOG ("Adding conversion elements for audio stream");
 
     arate = gst_element_factory_make ("audiorate", NULL);
-    g_object_set (arate, "tolerance", (guint64) ebin->tolerance, NULL);
     if (!arate) {
       missing_element_name = "audiorate";
       goto missing_element;
     }
+    g_object_set (arate, "tolerance", (guint64) ebin->tolerance, NULL);
     aconv = gst_element_factory_make ("audioconvert", NULL);
     aconv2 = gst_element_factory_make ("audioconvert", NULL);
     ares = gst_element_factory_make ("audioresample", NULL);