]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/commitdiff
ducatividdec: fix NPE if outcaps are EMPTY
authorRob Clark <rob@ti.com>
Sat, 3 Dec 2011 23:49:39 +0000 (17:49 -0600)
committerRob Clark <rob@ti.com>
Sun, 11 Dec 2011 23:49:41 +0000 (17:49 -0600)
src/gstducatividdec.c

index c0d159bfca0290dd28dfd4c81804570678e9a436..d4fe417e78e95fcc68ed091a2471bfa46521018f 100644 (file)
@@ -561,8 +561,17 @@ gst_ducati_viddec_sink_setcaps (GstPad * pad, GstCaps * caps)
   if (outcaps) {
     outcaps = gst_caps_make_writable (outcaps);
     gst_caps_truncate (outcaps);
-  } else {
-    outcaps = gst_caps_new_simple ("video/x-raw-yuv-strided",
+    if (gst_caps_is_empty (outcaps)) {
+      gst_caps_unref (outcaps);
+      outcaps = NULL;
+    }
+  }
+
+  if (!outcaps) {
+    /* note: default to non-strided for better compatibility with
+     * other gst elements that don't understand stride:
+     */
+    outcaps = gst_caps_new_simple ("video/x-raw-yuv",
         "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('N', 'V', '1', '2'), NULL);
   }