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
|
For a lengthy discussion see https://github.com/mpv-player/mpv/issues/2631
Upstream commits:
https://github.com/mpv-player/mpv/commit/1a6f3c56ea6e7bf9928fc99469f8f5da4578f035
https://github.com/mpv-player/mpv/commit/946bd52a1d1eb561ff8bb516ef6efcd02ca3ea1e
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index 00cd535..f607c23 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -606,7 +606,13 @@ int mpgl_validate_backend_opt(struct mp_log *log, const struct m_option *opt,
}
#if HAVE_C11_TLS
-static _Thread_local MPGLContext *current_context;
+#define MP_TLS _Thread_local
+#elif defined(__GNU__)
+#define MP_TLS __thread
+#endif
+
+#ifdef MP_TLS
+static MP_TLS MPGLContext *current_context;
static void * GLAPIENTRY get_native_display(const char *name)
{
diff --git a/wscript b/wscript
index a5e6914..969d9cc 100644
--- a/wscript
+++ b/wscript
@@ -718,7 +718,6 @@ video_output_features = [
}, {
'name': 'vaapi-egl',
'desc': 'VAAPI EGL',
- 'deps': [ 'c11-tls' ], # indirectly
'deps_any': [ 'vaapi-x-egl', 'vaapi-wayland' ],
'func': check_true,
}, {
|