Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
872bfb52
Commit
872bfb52
authored
Jun 06, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force thread priorities in the supported range
(assuming rt-offset is zero)
parent
fbb8255d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
include/vlc_threads.h
include/vlc_threads.h
+6
-6
src/misc/threads.c
src/misc/threads.c
+9
-9
No files found.
include/vlc_threads.h
View file @
872bfb52
...
...
@@ -58,12 +58,12 @@
/* Thread priorities */
#ifdef __APPLE__
# define VLC_THREAD_PRIORITY_LOW
(-47)
# define VLC_THREAD_PRIORITY_INPUT
37
# define VLC_THREAD_PRIORITY_AUDIO
37
# define VLC_THREAD_PRIORITY_VIDEO
(-47)
# define VLC_THREAD_PRIORITY_OUTPUT
37
# define VLC_THREAD_PRIORITY_HIGHEST
37
# define VLC_THREAD_PRIORITY_LOW
0
# define VLC_THREAD_PRIORITY_INPUT
22
# define VLC_THREAD_PRIORITY_AUDIO
22
# define VLC_THREAD_PRIORITY_VIDEO
0
# define VLC_THREAD_PRIORITY_OUTPUT
22
# define VLC_THREAD_PRIORITY_HIGHEST
22
#elif defined(SYS_BEOS)
# define VLC_THREAD_PRIORITY_LOW 5
...
...
src/misc/threads.c
View file @
872bfb52
...
...
@@ -515,19 +515,19 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
if
(
config_GetInt
(
p_this
,
"rt-priority"
)
>
0
)
#endif
{
struct
sched_param
p
=
{
.
sched_priority
=
i_priority
,
};
int
policy
;
/* Hack to avoid error msg */
if
(
config_GetType
(
p_this
,
"rt-offset"
)
)
i
_priority
+=
config_GetInt
(
p_this
,
"rt-offset"
);
if
(
i
_priority
<=
0
)
p
thread_attr_setschedpolicy
(
&
attr
,
SCHED_OTHER
);
p
.
sched
_priority
+=
config_GetInt
(
p_this
,
"rt-offset"
);
if
(
p
.
sched
_priority
<=
0
)
p
.
sched_priority
+=
sched_get_priority_max
(
policy
=
SCHED_OTHER
);
else
{
struct
sched_param
param
=
{
.
sched_priority
=
i_priority
,
};
p
.
sched_priority
+=
sched_get_priority_min
(
policy
=
SCHED_RR
);
param
.
sched_priority
+=
sched_get_priority_min
(
SCHED_RR
);
pthread_attr_setschedpolicy
(
&
attr
,
SCHED_RR
);
pthread_attr_setschedparam
(
&
attr
,
&
param
);
}
pthread_attr_setschedpolicy
(
&
attr
,
policy
);
pthread_attr_setschedparam
(
&
attr
,
&
p
);
}
i_ret
=
pthread_create
(
&
p_priv
->
thread_id
,
&
attr
,
thread_entry
,
boot
);
...
...
Write
Preview
Markdown
is supported
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