Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4734af74
Commit
4734af74
authored
Jan 14, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OutputThread: use real-time priority
parent
5d17731b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
NEWS
NEWS
+1
-0
OutputThread.cxx
src/OutputThread.cxx
+3
-0
Util.hxx
src/thread/Util.hxx
+13
-0
No files found.
NEWS
View file @
4734af74
...
...
@@ -18,6 +18,7 @@ ver 0.19 (not yet released)
- shine: new encoder plugin
* new resampler option using libsoxr
* the update thread runs at "idle" priority
* the output thread runs at "real-time" priority
ver 0.18.7 (2013/01/13)
* playlist
...
...
src/OutputThread.cxx
View file @
4734af74
...
...
@@ -30,6 +30,7 @@
#include "PlayerControl.hxx"
#include "MusicPipe.hxx"
#include "MusicChunk.hxx"
#include "thread/Util.hxx"
#include "system/FatalError.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
...
...
@@ -578,6 +579,8 @@ audio_output_task(void *arg)
{
struct
audio_output
*
ao
=
(
struct
audio_output
*
)
arg
;
SetThreadRealtime
();
ao
->
mutex
.
lock
();
while
(
1
)
{
...
...
src/thread/Util.hxx
View file @
4734af74
...
...
@@ -69,4 +69,17 @@ SetThreadIdlePriority()
#endif
};
/**
* Raise the current thread's priority to "real-time" (very high).
*/
static
inline
void
SetThreadRealtime
()
{
#ifdef __linux__
struct
sched_param
sched_param
;
sched_param
.
sched_priority
=
50
;
sched_setscheduler
(
0
,
SCHED_FIFO
,
&
sched_param
);
#endif
};
#endif
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