d3dvideosink: only warn about HWND already set if new HWND is not NULL
authorAaron Boxer <aaron.boxer@collabora.com>
Sat, 7 Dec 2019 15:34:55 +0000 (09:34 -0600)
committerAaron Boxer <aaron.boxer@collabora.com>
Wed, 18 Dec 2019 18:15:06 +0000 (13:15 -0500)
sys/d3dvideosink/d3dhelpers.c

index 1043571..d0c4043 100644 (file)
@@ -1143,8 +1143,9 @@ d3d_set_window_handle (GstD3DVideoSink * sink, guintptr window_id,
   LOCK_SINK (sink);
 
   if (sink->d3d.window_handle == (HWND) window_id) {
-    GST_WARNING_OBJECT (sink, "Window HWND already set to: %" G_GUINTPTR_FORMAT,
-        window_id);
+    if (window_id)
+      GST_WARNING_OBJECT (sink,
+          "Window HWND already set to: %" G_GUINTPTR_FORMAT, window_id);
     goto end;
   }