File: 0060-hw-amf-keep-the-AMF-version-in-the-context.patch

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (52 lines) | stat: -rw-r--r-- 1,771 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 3 Sep 2024 09:07:14 +0200
Subject: hw/amf: keep the AMF version in the context

For FRC we may need to disable it before 1.4.34.

(cherry picked from commit de748458776f58f150edc06a4b9cac8c961dac20)
---
 modules/hw/amf/amf_helper.c | 6 +++---
 modules/hw/amf/amf_helper.h | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/hw/amf/amf_helper.c b/modules/hw/amf/amf_helper.c
index d83bef8..f0f6eae 100644
--- a/modules/hw/amf/amf_helper.c
+++ b/modules/hw/amf/amf_helper.c
@@ -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;
 
diff --git a/modules/hw/amf/amf_helper.h b/modules/hw/amf/amf_helper.h
index ff8487a..6befb49 100644
--- a/modules/hw/amf/amf_helper.h
+++ b/modules/hw/amf/amf_helper.h
@@ -29,6 +29,7 @@ struct vlc_amf_context
 {
     AMT_TYPE(AMFFactory) *pFactory;
     AMT_TYPE(AMFContext) *Context;
+    amf_uint64           Version;
     void            *Private;
 };