sys/xvimage/xvimagesink.c: Refuse to create an XvImage if we can't find the format.
authorJulien Moutte <julien@moutte.net>
Mon, 28 Nov 2005 10:43:26 +0000 (10:43 +0000)
committerJulien Moutte <julien@moutte.net>
Mon, 28 Nov 2005 10:43:26 +0000 (10:43 +0000)
Original commit message from CVS:
2005-11-28  Julien MOUTTE  <julien@moutte.net>

* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new):
Refuse to create an XvImage if we can't find the format.

ChangeLog
sys/xvimage/xvimagesink.c

index ffa44f7..3e1f62a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-28  Julien MOUTTE  <julien@moutte.net>
+
+       * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new):
+       Refuse to create an XvImage if we can't find the format.
+
 2005-11-28  Edward Hervey  <edward@fluendo.com>
 
        * gst-libs/gst/riff/riff-media.c:
index ebda451..dde51a4 100644 (file)
@@ -456,11 +456,11 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps)
   GST_LOG_OBJECT (xvimagesink, "creating %dx%d", xvimage->width,
       xvimage->height);
 
-  /* We should probably get that from the caps as well */
   xvimage->im_format = gst_xvimagesink_get_format_from_caps (xvimagesink, caps);
   if (!xvimage->im_format) {
     GST_WARNING_OBJECT (xvimagesink, "failed to get format from caps %"
         GST_PTR_FORMAT, caps);
+    goto beach_unlocked;
   }
   xvimage->xvimagesink = gst_object_ref (xvimagesink);
 
@@ -533,6 +533,7 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps)
 beach:
   g_mutex_unlock (xvimagesink->x_lock);
 
+beach_unlocked:
   if (!succeeded) {
     gst_xvimage_buffer_free (xvimage);
     xvimage = NULL;