[vlc-devel] [PATCH] aom: Disable module for WindowsXP

Steve Lhomme robux4 at ycbcr.xyz
Thu May 27 08:25:13 UTC 2021


On 2021-05-27 10:17, Hugo Beauzée-Luyssen wrote:
> On Thu, May 27, 2021, at 9:41 AM, Steve Lhomme wrote:
>> Is this for 3.0 ?
> 
> It is
> 
>>
>> IIRC these functions depend on the manifest and are not very reliable.
>>
>> Here's how we detect it in direct3d9.c
>>
>>       /* 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;
>>       }
>>
> 
> I can definitely use the same code if you have seen occurrences of the dedicated function failing.
> I've tested it on XP and Windows 10 but definitely not everything in between.

It's complicated https://stackoverflow.com/a/27324801/1266123

IMO we should stick with what we already have (or change all instances).
It seems the manifest is mostly for Win8/10 but since they all use the 
same underlying function it may not work as expected. And since the same 
code may be used in other projects not providing a manifest, as a rule 
of thumb, it's better not to rely on it in general.

>>
>> On 2021-05-26 17:55, Hugo Beauzée-Luyssen wrote:
>>> It consistantly crashes on that platform and seems to behave properly
>>> starting from Windows Vista
>>> Fix #25745
>>> ---
>>>    modules/codec/aom.c | 9 +++++++++
>>>    1 file changed, 9 insertions(+)
>>>
>>> diff --git a/modules/codec/aom.c b/modules/codec/aom.c
>>> index 29e84f899f..fb36aaec30 100644
>>> --- a/modules/codec/aom.c
>>> +++ b/modules/codec/aom.c
>>> @@ -37,6 +37,10 @@
>>>    
>>>    #include "../packetizer/iso_color_tables.h"
>>>    
>>> +#ifdef _WIN32
>>> +#include <versionhelpers.h>
>>> +#endif
>>> +
>>>    /****************************************************************************
>>>     * Local prototypes
>>>     ****************************************************************************/
>>> @@ -289,6 +293,11 @@ static int OpenDecoder(vlc_object_t *p_this)
>>>        const aom_codec_iface_t *iface;
>>>        int av_version;
>>>    
>>> +#ifdef _WIN32
>>> +    if (!IsWindowsVistaOrGreater())
>>> +        return VLC_EGENERIC;
>>> +#endif
>>> +
>>>        if (dec->fmt_in.i_codec != VLC_CODEC_AV1)
>>>            return VLC_EGENERIC;
>>>    
>>> -- 
>>> 2.30.2
>>>
>>> _______________________________________________
>>> vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> 
> 
> -- 
>    Hugo Beauzée-Luyssen
>    hugo at beauzee.fr
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list