d3dvideosink: Open Direct3D devices in a threadsafe way
authorSebastian Dröge <sebastian@centricular.com>
Tue, 15 Jul 2014 11:29:24 +0000 (13:29 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 15 Jul 2014 11:30:16 +0000 (13:30 +0200)
Otherwise we'll get crashes when using the device from multiple
threads, e.g. when using multiple sinks at once.

https://bugzilla.gnome.org/show_bug.cgi?id=707523

sys/d3dvideosink/d3dhelpers.c

index 6d22f38..312b913 100644 (file)
@@ -2374,6 +2374,9 @@ d3d_class_display_device_create (GstD3DVideoSinkClass * klass, UINT adapter)
    */
   create_mask = 0 | D3DCREATE_FPU_PRESERVE;
 
+  /* Make sure that device access is threadsafe */
+  create_mask |= D3DCREATE_MULTITHREADED;
+
   /* Determine vertex processing capabilities. Some cards have issues
    * using software vertex processing. Courtesy:
    * http://www.chadvernon.com/blog/resources/directx9/improved-direct3d-initialization/