OCaml 4.14.0 rebuild
[arch-packages.git] / vlc / repos / extra-x86_64 / caca-fix-to-newer-version.patch
blob8a56f767a1b0b6c7469e86f73f47ba87e92e2ad3
1 From 900318072a7ebce28745aa3863e1364b7258baff Mon Sep 17 00:00:00 2001
2 From: Alexandre Janniaux <ajanni@videolabs.io>
3 Date: Wed, 10 Nov 2021 15:37:52 +0100
4 Subject: [PATCH] caca: fix to newer version
6 Migrate to the new API instead of libcucul API, which has been merged
7 into libcaca since 0.99.beta15:
9 commit f61816ceb7445f8bf818936151554ac060764b39
10 Author: Sam Hocevar <sam@hocevar.net>
11 Date: Sat Sep 27 13:12:46 2008 +0000
13 Starting refactoring to get rid of libcucul. The initial reason for the
14 split is rendered moot by the plugin system: when enabled, binaries do
15 not link directly with libX11 or libGL. I hope this is a step towards
16 more consisteny and clarity.
18 It was then completely wiped out by the following commit, which is part
19 of v0.99.beta20:
21 commit 5f0ec215f8c9915ed028324a8ecac8212f68e18d
22 Author: Sam Hocevar <sam@hocevar.net>
23 Date: Thu May 3 10:33:30 2018 +0200
25 Remove legacy code from 10 years ago.
27 (cherry picked from commit d35391caa03c046149e7fe2497f51bf59ed8551d)
28 ---
29 modules/video_output/caca.c | 30 +++++++++++++++---------------
30 1 file changed, 15 insertions(+), 15 deletions(-)
32 diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
33 index 33a0409820..a2e922a864 100644
34 --- a/modules/video_output/caca.c
35 +++ b/modules/video_output/caca.c
36 @@ -74,9 +74,9 @@ static void Place(vout_display_t *, vout_display_place_t *);
38 /* */
39 struct vout_display_sys_t {
40 - cucul_canvas_t *cv;
41 + caca_canvas_t *cv;
42 caca_display_t *dp;
43 - cucul_dither_t *dither;
44 + caca_dither_t *dither;
46 picture_pool_t *pool;
47 vout_display_event_thread_t *et;
48 @@ -153,9 +153,9 @@ static int Open(vlc_object_t *object)
49 if (!sys)
50 goto error;
52 - sys->cv = cucul_create_canvas(0, 0);
53 + sys->cv = caca_create_canvas(0, 0);
54 if (!sys->cv) {
55 - msg_Err(vd, "cannot initialize libcucul");
56 + msg_Err(vd, "cannot initialize libcaca");
57 goto error;
60 @@ -209,11 +209,11 @@ error:
61 if (sys->pool)
62 picture_pool_Release(sys->pool);
63 if (sys->dither)
64 - cucul_free_dither(sys->dither);
65 + caca_free_dither(sys->dither);
66 if (sys->dp)
67 caca_free_display(sys->dp);
68 if (sys->cv)
69 - cucul_free_canvas(sys->cv);
70 + caca_free_canvas(sys->cv);
72 free(sys);
74 @@ -235,9 +235,9 @@ static void Close(vlc_object_t *object)
75 if (sys->pool)
76 picture_pool_Release(sys->pool);
77 if (sys->dither)
78 - cucul_free_dither(sys->dither);
79 + caca_free_dither(sys->dither);
80 caca_free_display(sys->dp);
81 - cucul_free_canvas(sys->cv);
82 + caca_free_canvas(sys->cv);
84 #if defined(_WIN32)
85 FreeConsole();
86 @@ -266,7 +266,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
88 if (!sys->dither) {
89 /* Create the libcaca dither object */
90 - sys->dither = cucul_create_dither(32,
91 + sys->dither = caca_create_dither(32,
92 vd->source.i_visible_width,
93 vd->source.i_visible_height,
94 picture->p[0].i_pitch,
95 @@ -284,12 +284,12 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
96 vout_display_place_t place;
97 Place(vd, &place);
99 - cucul_set_color_ansi(sys->cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_BLACK);
100 - cucul_clear_canvas(sys->cv);
101 + caca_set_color_ansi(sys->cv, CACA_DEFAULT, CACA_BLACK);
102 + caca_clear_canvas(sys->cv);
104 const int crop_offset = vd->source.i_y_offset * picture->p->i_pitch +
105 vd->source.i_x_offset * picture->p->i_pixel_pitch;
106 - cucul_dither_bitmap(sys->cv, place.x, place.y,
107 + caca_dither_bitmap(sys->cv, place.x, place.y,
108 place.width, place.height,
109 sys->dither,
110 &picture->p->p_pixels[crop_offset]);
111 @@ -328,7 +328,7 @@ static int Control(vout_display_t *vd, int query, va_list args)
113 case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
114 if (sys->dither)
115 - cucul_free_dither(sys->dither);
116 + caca_free_dither(sys->dither);
117 sys->dither = NULL;
118 return VLC_SUCCESS;
120 @@ -366,8 +366,8 @@ static void Place(vout_display_t *vd, vout_display_place_t *place)
122 vout_display_PlacePicture(place, &vd->source, vd->cfg, false);
124 - const int canvas_width = cucul_get_canvas_width(sys->cv);
125 - const int canvas_height = cucul_get_canvas_height(sys->cv);
126 + const int canvas_width = caca_get_canvas_width(sys->cv);
127 + const int canvas_height = caca_get_canvas_height(sys->cv);
128 const int display_width = caca_get_display_width(sys->dp);
129 const int display_height = caca_get_display_height(sys->dp);