be more graceful when caps negotiation fails
authorDavid Schleef <ds@schleef.org>
Mon, 30 Jun 2003 05:21:09 +0000 (05:21 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 30 Jun 2003 05:21:09 +0000 (05:21 +0000)
Original commit message from CVS:
be more graceful when caps negotiation fails

gst/videoscale/gstvideoscale.c

index 289da9f1143a93851c6f90b59a108abb5f57841a..ed422636866a95922a5a9a6bfd1b19180eb94a82 100644 (file)
@@ -241,12 +241,14 @@ gst_videoscale_src_link (GstPad *pad, GstCaps *caps)
     return GST_PAD_LINK_DELAYED;
   }
 
+  gst_caps_debug(caps,"ack");
+
   videoscale->format = videoscale_find_by_caps (caps);
+  g_return_val_if_fail(videoscale->format, GST_PAD_LINK_REFUSED);
+
   gst_caps_get_int (caps, "width", &videoscale->to_width);
   gst_caps_get_int (caps, "height", &videoscale->to_height);
 
-  gst_videoscale_setup(videoscale);
-
   GST_DEBUG ("width %d height %d",videoscale->to_width,videoscale->to_height);
 
   peercaps = gst_caps_copy(caps);
@@ -283,12 +285,14 @@ gst_videoscale_sink_link (GstPad *pad, GstCaps *caps)
     return GST_PAD_LINK_DELAYED;
   }
 
+
   videoscale->format = videoscale_find_by_caps (caps);
+  gst_caps_debug(caps,"ack");
+  g_return_val_if_fail(videoscale->format, GST_PAD_LINK_REFUSED);
+
   gst_caps_get_int (caps, "width", &videoscale->from_width);
   gst_caps_get_int (caps, "height", &videoscale->from_height);
 
-  gst_videoscale_setup(videoscale);
-
   peercaps = gst_caps_copy(caps);
 
   if(videoscale->force_size){