gst-android: Don't ignore value returned when registering fb

Reynaldo H. Verdejo Pinochet reynaldo at kemper.freedesktop.org
Thu Jan 19 14:50:15 PST 2012


Module: gst-android
Branch: master
Commit: 1ccad5a70d853886c50a73e5484a8d212cad184b
URL:    http://cgit.freedesktop.org/gstreamer/gst-android/commit/?id=1ccad5a70d853886c50a73e5484a8d212cad184b

Author: Reynaldo H. Verdejo Pinochet <reynaldo at collabora.com>
Date:   Thu Jan 19 19:46:46 2012 -0300

Don't ignore value returned when registering fb

Act upon a posible error return from _device_register_framebuffer,
propagating the error accordingly.

---

 sink/surfaceflingersink/gstsurfaceflingersink.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/sink/surfaceflingersink/gstsurfaceflingersink.c b/sink/surfaceflingersink/gstsurfaceflingersink.c
index 5f40577..4355173 100644
--- a/sink/surfaceflingersink/gstsurfaceflingersink.c
+++ b/sink/surfaceflingersink/gstsurfaceflingersink.c
@@ -157,11 +157,14 @@ gst_surfaceflinger_sink_setcaps (GstBaseSink * bsink, GstCaps * vscapslist)
       surfacesink->width, surfacesink->height, surfacesink->pixel_format);
 
   /* register frame buffer */
-  videoflinger_device_register_framebuffers (surfacesink->videodev,
-      surfacesink->width, surfacesink->height, surfacesink->pixel_format);
-
-  GST_DEBUG_OBJECT (surfacesink, "gst_surfaceflinger_sink_setcaps return true");
-  return TRUE;
+  if (videoflinger_device_register_framebuffers (surfacesink->videodev,
+      surfacesink->width, surfacesink->height, surfacesink->pixel_format)
+      != -1)
+    return TRUE;
+
+  GST_ERROR_OBJECT (surfacesink,
+      "Unable to register framebuffer device with given caps");
+  return FALSE;
 }
 
 



More information about the gstreamer-commits mailing list