hw/amf: keep the AMF version in the context
authorSteve Lhomme <robux4@ycbcr.xyz>
Tue, 3 Sep 2024 07:07:14 +0000 (09:07 +0200)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
For FRC we may need to disable it before 1.4.34.

(cherry picked from commit de748458776f58f150edc06a4b9cac8c961dac20)

Gbp-Pq: Name 0060-hw-amf-keep-the-AMF-version-in-the-context.patch

modules/hw/amf/amf_helper.c
modules/hw/amf/amf_helper.h

index d83bef8abe8d93702b169e0d23dd1dbefdc82edc..f0f6eaece4148d04346b4981f43125f973c7acf2 100644 (file)
@@ -21,12 +21,12 @@ int vlc_AMFCreateContext(struct vlc_amf_context *c)
     if (hLib == NULL)
         return (-ENOTSUP);
 
-    amf_uint64 version = 0;
+    c->Version = 0;
     AMF_RESULT res;
     AMFQueryVersion_Fn queryVersion = (AMFQueryVersion_Fn)GetProcAddress(hLib, AMF_QUERY_VERSION_FUNCTION_NAME);
     if (unlikely(queryVersion == NULL))
         goto error;
-    res = queryVersion(&version);
+    res = queryVersion(&c->Version);
     if (unlikely(res != AMF_OK))
         goto error;
 
@@ -34,7 +34,7 @@ int vlc_AMFCreateContext(struct vlc_amf_context *c)
     c->Context = NULL;
 
     AMFInit_Fn init = (AMFInit_Fn)GetProcAddress(hLib, AMF_INIT_FUNCTION_NAME);
-    res = init(version, &c->pFactory);
+    res = init(c->Version, &c->pFactory); // use the highest possible value for that DLL
     if (unlikely(res != AMF_OK))
         goto error;
 
index ff8487af4378196583aa9252270f71381706a3e7..6befb497145c01255f75a360d0e56150304caff0 100644 (file)
@@ -29,6 +29,7 @@ struct vlc_amf_context
 {
     AMT_TYPE(AMFFactory) *pFactory;
     AMT_TYPE(AMFContext) *Context;
+    amf_uint64           Version;
     void            *Private;
 };