[0.10] gst-plugins-bad: d3dvideosink: Fix device initialization check

Tim Müller tpm at kemper.freedesktop.org
Thu Feb 9 12:12:42 PST 2012


Module: gst-plugins-bad
Branch: 0.10
Commit: 64b17ebde2bc615690f0f2a917080081d0222e9a
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=64b17ebde2bc615690f0f2a917080081d0222e9a

Author: Andoni Morales Alastruey <ylatuya at gmail.com>
Date:   Sat Aug 27 13:07:00 2011 +0200

d3dvideosink: Fix device initialization check

---

 sys/d3dvideosink/d3dvideosink.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/sys/d3dvideosink/d3dvideosink.c b/sys/d3dvideosink/d3dvideosink.c
index 53d5c89..ed4d249 100644
--- a/sys/d3dvideosink/d3dvideosink.c
+++ b/sys/d3dvideosink/d3dvideosink.c
@@ -495,6 +495,9 @@ gst_d3dvideosink_create_shared_hidden_window (GstD3DVideoSink * sink)
 
   CloseHandle (shared.hidden_window_created_signal);
 
+  if (!shared.d3ddev)
+     goto failed;
+
   GST_DEBUG ("Successfully created Direct3D hidden window, handle: %p",
       shared.hidden_window_handle);
 
@@ -1356,7 +1359,8 @@ gst_d3dvideosink_change_state (GstElement * element, GstStateChange transition)
 
   switch (transition) {
     case GST_STATE_CHANGE_NULL_TO_READY:
-      gst_d3dvideosink_initialize_direct3d (sink);
+      if (!gst_d3dvideosink_initialize_direct3d (sink))
+        return GST_STATE_CHANGE_FAILURE; 
       break;
     case GST_STATE_CHANGE_READY_TO_PAUSED:
       break;



More information about the gstreamer-commits mailing list