[vlc-commits] os2: thread: make VLC_THREAD_PRIORITY_XXX macros constant
KO Myung-Hun
git at videolan.org
Fri Jan 29 14:54:33 UTC 2021
vlc | branch: master | KO Myung-Hun <komh78 at gmail.com> | Wed Jan 20 10:49:00 2021 +0100| [94ac0cb17c262a0f7f3ee1c929ac51da4abc3895] | committer: Steve Lhomme
os2: thread: make VLC_THREAD_PRIORITY_XXX macros constant
This fixes compilation of src/input/decoder.c
and modules/stream_out/transcode/transcode.c.
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=94ac0cb17c262a0f7f3ee1c929ac51da4abc3895
---
include/vlc_threads.h | 10 ++++------
src/os2/thread.c | 12 ++++++++----
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 0aac31afbf..a333f0cd14 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -92,13 +92,11 @@ typedef struct vlc_threadvar *vlc_threadvar_t;
typedef struct vlc_timer *vlc_timer_t;
# define VLC_THREAD_PRIORITY_LOW 0
-# define VLC_THREAD_PRIORITY_INPUT \
- MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
-# define VLC_THREAD_PRIORITY_AUDIO MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
+# define VLC_THREAD_PRIORITY_INPUT 1
+# define VLC_THREAD_PRIORITY_AUDIO VLC_THREAD_PRIORITY_HIGHEST
# define VLC_THREAD_PRIORITY_VIDEO 0
-# define VLC_THREAD_PRIORITY_OUTPUT \
- MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
-# define VLC_THREAD_PRIORITY_HIGHEST MAKESHORT(0, PRTYC_TIMECRITICAL)
+# define VLC_THREAD_PRIORITY_OUTPUT 1
+# define VLC_THREAD_PRIORITY_HIGHEST 2
# define pthread_sigmask sigprocmask
diff --git a/src/os2/thread.c b/src/os2/thread.c
index 1c4774f04c..fba569c6f0 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -475,10 +475,14 @@ int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *),
*p_handle = th;
if (priority)
- DosSetPriority(PRTYS_THREAD,
- HIBYTE(priority),
- LOBYTE(priority),
- th->tid);
+ {
+ LONG delta = PRTYD_MAXIMUM;
+
+ if (priority != VLC_THREAD_PRIORITY_HIGHEST)
+ delta >>= 1;
+
+ DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, delta, th->tid );
+ }
return 0;
More information about the vlc-commits
mailing list