omx: Only unref caps after usage of its fields
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 14 Mar 2013 14:03:02 +0000 (15:03 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 14 Mar 2013 14:03:02 +0000 (15:03 +0100)
omx/gstomxh263enc.c
omx/gstomxh264enc.c
omx/gstomxmpeg4videoenc.c

index 2fea91e..e3c1a99 100644 (file)
@@ -197,13 +197,13 @@ gst_omx_h263_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
   return TRUE;
 
 unsupported_profile:
-  gst_caps_unref (peercaps);
   GST_ERROR_OBJECT (self, "Unsupported profile %u", profile_id);
+  gst_caps_unref (peercaps);
   return FALSE;
 
 unsupported_level:
-  gst_caps_unref (peercaps);
   GST_ERROR_OBJECT (self, "Unsupported level %u", level_id);
+  gst_caps_unref (peercaps);
   return FALSE;
 }
 
index 75f7897..9adac04 100644 (file)
@@ -200,13 +200,13 @@ gst_omx_h264_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
   return TRUE;
 
 unsupported_profile:
-  gst_caps_unref (peercaps);
   GST_ERROR_OBJECT (self, "Unsupported profile %s", profile_string);
+  gst_caps_unref (peercaps);
   return FALSE;
 
 unsupported_level:
-  gst_caps_unref (peercaps);
   GST_ERROR_OBJECT (self, "Unsupported level %s", level_string);
+  gst_caps_unref (peercaps);
   return FALSE;
 }
 
index 14dfc34..15b8ce7 100644 (file)
@@ -207,13 +207,13 @@ gst_omx_mpeg4_video_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
   return TRUE;
 
 unsupported_profile:
-  gst_caps_unref (intersection);
   GST_ERROR_OBJECT (self, "Unsupported profile %s", profile_string);
+  gst_caps_unref (intersection);
   return FALSE;
 
 unsupported_level:
-  gst_caps_unref (intersection);
   GST_ERROR_OBJECT (self, "Unsupported level %s", level_string);
+  gst_caps_unref (intersection);
   return FALSE;
 }