From d96999328ad80941fbdb51f64d46fa540463ca62 Mon Sep 17 00:00:00 2001 From: Alexey Chernov <4ernov@gmail.com> Date: Tue, 21 Jan 2014 09:44:00 +0100 Subject: [PATCH] d3dvideosink: First destroy the window, then unregister the class It's impossible to create another pipeline with d3dvideosink after disposing the previous one due to some problem in d3dvideosink. The message is: "Unable to register Direct3D hidden window class". I've evaluated the problem and it's that UnregisterClass() in working thread is called before DestroyWindow() and UnregisterClass() does nothing. https://bugzilla.gnome.org/show_bug.cgi?id=722622 --- sys/d3dvideosink/d3dhelpers.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/d3dvideosink/d3dhelpers.c b/sys/d3dvideosink/d3dhelpers.c index e405b1c457..d778e3572d 100644 --- a/sys/d3dvideosink/d3dhelpers.c +++ b/sys/d3dvideosink/d3dhelpers.c @@ -684,7 +684,8 @@ fallback: } static void -gst_d3dsurface_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer) +gst_d3dsurface_buffer_pool_release_buffer (GstBufferPool * bpool, + GstBuffer * buffer) { GstMemory *mem = NULL; @@ -2590,12 +2591,12 @@ d3d_hidden_window_thread (GstD3DVideoSinkClass * klass) error: if (!ret) klass->d3d.error_exit = TRUE; - if (reged) - UnregisterClass (WndClass.lpszClassName, WndClass.hInstance); if (hWnd) { DestroyWindow (hWnd); klass->d3d.hidden_window = 0; } + if (reged) + UnregisterClass (WndClass.lpszClassName, WndClass.hInstance); d3d_class_display_device_destroy (klass); return ret;