Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
1da38fda
Commit
1da38fda
authored
Apr 21, 2012
by
Rafaël Carré
Browse files
Update pthreads patch
parent
4c974289
Changes
2
Hide whitespace changes
Inline
Side-by-side
compile.sh
View file @
1da38fda
...
...
@@ -38,7 +38,7 @@ fi
export
PATH
=
${
ANDROID_NDK
}
/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:
${
PATH
}
# 1/ libvlc, libvlccore and its plugins
TESTED_HASH
=
15b1a1b94
TESTED_HASH
=
5069692bfb
if
[
!
-d
"vlc"
]
;
then
echo
"VLC source not found, cloning"
git clone git://git.videolan.org/vlc.git vlc
...
...
patches/0001-android-threads-support.patch
View file @
1da38fda
From
dc995ad26afac5a8f86dde801df87b62a73d2e58
Mon Sep 17 00:00:00 2001
From
650f20450edb1a52a272afa046b2d2e5231b5594
Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= <funman@videolan.org>
Date: Sat, 10 Mar 2012 04:54:23 -0500
Subject: [PATCH 1/3] android: threads support
...
...
@@ -31,10 +31,10 @@ timer, rwlocks, mutexes, clock, threadvar
are 100% shared with linux so it'd be useless to have 2 copies.
---
include/vlc_threads.h | 13 +++
lib/error.c | 1
6
++
+-
lib/error.c | 1
0
++
src/Makefile.am | 17 ++++
src/posix/thread.c | 245 +++++++++++++++++++++++++++++++++++++++++++------
4 files changed, 2
61
insertions(+),
30
deletions(-)
4 files changed, 2
57
insertions(+),
28
deletions(-)
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index ebf94e2..dad50b1 100644
...
...
@@ -69,38 +69,35 @@ index ebf94e2..dad50b1 100644
#define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER
typedef pthread_cond_t vlc_cond_t;
diff --git a/lib/error.c b/lib/error.c
index
ef2ecdc..42f6b4e
100644
index
d053faa..52840e8
100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -3
5
,1
7
+3
5,29
@@
static v
oid libvlc_setup_threads (bool init)
static vlc_mutex_t lock = VLC_STATIC_MUTEX;
static uintptr_t refs = 0;
@@ -3
3
,1
1
+3
3,17
@@
static v
lc_threadvar_t context;
static vlc_mutex_t lock = VLC_STATIC_MUTEX;
static uintptr_t refs = 0;
+
void andro_init_threads(bool);
+void andro_init_threads(bool);
+
void libvlc_threads_init (void)
{
vlc_mutex_lock (&lock);
if (
init
)
if (
refs++ == 0
)
{
- if (refs++ == 0)
+ if (refs++ == 0) {
+#ifdef __ANDROID__
+ /* XXX: move somewhere else? */
+ andro_init_threads(
init
);
+ andro_init_threads(
true
);
+#endif
vlc_threadvar_create (&context, free);
+
}
vlc_threadvar_create (&context, free);
libvlc_log_init ();
}
else
@@ -52,6 +58,10 @@
void libvlc_threads_deinit (void)
{
assert (refs > 0);
- if (--refs == 0)
+ if (--refs == 0) {
vlc_threadvar_delete (&context);
libvlc_log_deinit ();
vlc_threadvar_delete (&context);
+#ifdef __ANDROID__
+ /* XXX: move somewhere else? */
+ andro_init_threads(
init
);
+ andro_init_threads(
false
);
+#endif
+ }
}
vlc_mutex_unlock (&lock);
}
...
...
@@ -154,7 +151,7 @@ index 9ab1ca6..27bf38e 100644
posix/dirs.c \
misc/atomic.c \
diff --git a/src/posix/thread.c b/src/posix/thread.c
index a7a4873..
6c36980
100644
index a7a4873..
598c692
100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -1,5 +1,5 @@
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment