[vlc-commits] [Git][videolan/vlc][master] 2 commits: direct3d9: remove Vista detection

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Jun 11 19:26:26 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
d0de6a3a by Steve Lhomme at 2022-06-11T18:02:09+00:00
direct3d9: remove Vista detection

VLC 4.0 cannot be compiled or run for versions before Windows 7.

- - - - -
a8ec494d by Steve Lhomme at 2022-06-11T18:02:09+00:00
udp: clean Win8 detection

This is in line with the other places where we check for Win8.1 and Win10.

We don't need to load a specific library, we check what is available in
kernel32. GetCurrentThreadStackLimits is available since Win8 in all builds [1]

[1] https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadstacklimits

- - - - -


2 changed files:

- modules/video_output/win32/direct3d9.c
- src/network/udp.c


Changes:

=====================================
modules/video_output/win32/direct3d9.c
=====================================
@@ -1773,17 +1773,6 @@ static int Open(vout_display_t *vd,
     if ( !vd->obj.force && vd->source->mastering.max_luminance != 0)
         return VLC_EGENERIC; /* let a module who can handle it do it */
 
-    /* do not use D3D9 on XP unless forced */
-    if (!vd->obj.force)
-    {
-        bool isVistaOrGreater = false;
-        HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
-        if (likely(hKernel32 != NULL))
-            isVistaOrGreater = GetProcAddress(hKernel32, "EnumResourceLanguagesExW") != NULL;
-        if (!isVistaOrGreater)
-            return VLC_EGENERIC;
-    }
-
     /* Allocate structure */
     vd->sys = sys = calloc(1, sizeof(vout_display_sys_t));
     if (!sys)


=====================================
src/network/udp.c
=====================================
@@ -101,19 +101,21 @@ static int net_SetupDgramSocket (vlc_object_t *p_obj, int fd,
     /* Check windows version so we know if we need to increase receive buffers
      * for Windows 7 and earlier
 
-     * SetSocketMediaStreamingMode is present in win 8 and later, so we set
+     * GetCurrentThreadStackLimits is present in win 8 and later, so we set
      * receive buffer if that isn't present
      */
 #if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
-    HINSTANCE h_Network = LoadLibrary(TEXT("Windows.Networking.dll"));
-    if( (h_Network == NULL) ||
-        (GetProcAddress( h_Network, "SetSocketMediaStreamingMode" ) == NULL ) )
+    bool isWin8OrGreater = false;
+    HMODULE h = GetModuleHandle(TEXT("api-ms-win-core-processthreads-l1-1-1.dll"));
+    if (h == NULL)
+        h = GetModuleHandle(TEXT("kernel32.dll"));
+    if (likely(h != NULL))
+        isWin8OrGreater = GetProcAddress(h, "GetCurrentThreadStackLimits") != NULL;
+    if (!isWin8OrGreater)
     {
         setsockopt (fd, SOL_SOCKET, SO_RCVBUF,
                          (void *)&(int){ 0x80000 }, sizeof (int));
     }
-    if( h_Network )
-        FreeLibrary( h_Network );
 #endif
 
     if (net_SockAddrIsMulticast (ptr->ai_addr, ptr->ai_addrlen))



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e0a4b82efbf7e6c184afc4ae7a78fcffa69649e8...a8ec494dcb74b90ebfd7f0931477ce85c8d9871b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e0a4b82efbf7e6c184afc4ae7a78fcffa69649e8...a8ec494dcb74b90ebfd7f0931477ce85c8d9871b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list