d3dvideosink: destroy device just before final d3d release call
authorAaron Boxer <aaron.boxer@collabora.com>
Sat, 7 Dec 2019 05:50:50 +0000 (23:50 -0600)
committerAaron Boxer <aaron.boxer@collabora.com>
Wed, 18 Dec 2019 18:15:05 +0000 (13:15 -0500)
and free overlays after swap chain is released

sys/d3dvideosink/d3dhelpers.c
sys/d3dvideosink/d3dvideosink.c

index dd93e82..6ecc0a8 100644 (file)
@@ -1427,6 +1427,7 @@ d3d_release_swap_chain (GstD3DVideoSink * sink)
     GST_DEBUG_OBJECT (sink, "D3D surface released. Ref count: %d", ref_count);
   }
 
+  gst_d3d9_overlay_free (sink);
   ret = TRUE;
 
 end:
@@ -2507,6 +2508,7 @@ d3d_class_destroy (GstD3DVideoSink * sink)
 
   LOCK_CLASS (sink, klass);
 
+  d3d_class_display_device_destroy (klass);
   if (klass->d3d.d3d) {
     int ref_count;
     ref_count = IDirect3D9_Release (klass->d3d.d3d);
@@ -2814,7 +2816,6 @@ error:
   }
   if (reged)
     UnregisterClass (WndClass.lpszClassName, WndClass.hInstance);
-  d3d_class_display_device_destroy (klass);
 
   return ret;
 }
index 2cc283e..41647c0 100644 (file)
@@ -448,7 +448,6 @@ gst_d3dvideosink_stop (GstBaseSink * bsink)
 
   GST_DEBUG_OBJECT (bsink, "Stop() called");
   d3d_stop (sink);
-  gst_d3d9_overlay_free (sink);
   d3d_class_destroy (sink);
 
   return TRUE;