[vlc-devel] [PATCH]: fix a CoInitializeEx() issue on Windows

erwan.tulou at gmail.com erwan.tulou at gmail.com
Fri Jul 12 14:30:34 CEST 2019


Hello,

      On Windows, this patch fixes vlc_assert_unreachable() when a User 
interface is also acting as a vout window submodule and as such triggers 
vout_window_ReportSize().

Rgds




---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
-------------- next part --------------
From e674d3985ad69ebdf05055263b644c0a18af601a Mon Sep 17 00:00:00 2001
From: Erwan <erwan10 at videolan.org>
Date: Fri, 12 Jul 2019 13:24:02 +0200
Subject: [PATCH] window: fix CoInitializeEx issue

  Since this call is now executed in the UI thread (triggered via
vout_window_ReportSize(), it must re-use the same policy as
already used by the thread. For UI threads, microsoft doc advises
COINIT_APARTMENTTHREADED which is indeed what the Qt thread and skins2
thread are already set up with.

This fixes vlc_assert_unreachable() with skins2 and probably Qt when embedded
video will be reinstated.
---
 modules/video_output/win32/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index b31c77d0be..9cb1bf7c09 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -162,7 +162,7 @@ static void CommonChangeThumbnailClip(vlc_object_t *obj, vout_display_sys_win32_
     if (!GetVersionEx(&winVer) || winVer.dwMajorVersion <= 5)
         return;
 
-    if( FAILED(CoInitializeEx(NULL, COINIT_MULTITHREADED)) )
+    if( FAILED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)) )
         vlc_assert_unreachable();
 
     void *ptr;
-- 
2.20.1



More information about the vlc-devel mailing list