File: 0125-x265-fix-API-signature-with-x265-4.1.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 (49 lines) | stat: -rw-r--r-- 1,609 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
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 13 Jan 2025 10:35:07 +0100
Subject: x265: fix API signature with x265 4.1

They changed the API in c69c113960834400545bc4bce2830ff51dcb86b3
And then reverted it in
78e5b703b186fe184bf91bb37df82f64059b3f61

The X265_BUILD is how you can tell the x265 version(s). But they didn't change
the values in these commits.

- X265_BUILD was 210 when the API was changed
- X265_BUILD was 214 when the API was reverted
---
 modules/codec/x265.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/codec/x265.c b/modules/codec/x265.c
index 50fe328..9c3c231 100644
--- a/modules/codec/x265.c
+++ b/modules/codec/x265.c
@@ -39,6 +39,9 @@
 #ifndef X265_MAX_FRAME_THREADS
 # define X265_MAX_FRAME_THREADS 16
 #endif
+#if X265_BUILD > 210 && X265_BUILD <= 214
+#define X265_OUTPUT_ARRAY 1
+#endif
 
 /*****************************************************************************
  * Module descriptor
@@ -74,7 +77,7 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
     x265_picture pic;
 
     x265_picture_init(&p_sys->param, &pic);
-#ifdef MAX_SCALABLE_LAYERS
+#ifdef X265_OUTPUT_ARRAY
     /* Handle API changes for scalable layers output in x265 4.0 */
     x265_picture *pics[MAX_SCALABLE_LAYERS] = {NULL};
     pics[0] = &pic;
@@ -97,7 +100,7 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
 
     x265_nal *nal;
     uint32_t i_nal = 0;
-#ifdef MAX_SCALABLE_LAYERS
+#ifdef X265_OUTPUT_ARRAY
     x265_encoder_encode(p_sys->h, &nal, &i_nal,
                         likely(p_pict) ? &pic : NULL, pics);
 #else