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
d73267df
Commit
d73267df
authored
Sep 19, 2016
by
Yue Wang
Committed by
GitHub
Sep 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use osx_output_delay to wait until ring buffer is able to write
This further optimize the performance. This is now working properly with a conditional variable bug being fixed (
8bbfb5cd
).
parent
8bbfb5cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
OSXOutputPlugin.cxx
src/output/plugins/OSXOutputPlugin.cxx
+8
-7
No files found.
src/output/plugins/OSXOutputPlugin.cxx
View file @
d73267df
...
...
@@ -740,15 +740,16 @@ osx_output_play(AudioOutput *ao, const void *chunk, size_t size,
gcc_unused
Error
&
error
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
while
(
!
od
->
ring_buffer
->
write_available
())
{
struct
timespec
req
;
req
.
tv_sec
=
0
;
req
.
tv_nsec
=
25
*
1e6
;
nanosleep
(
&
req
,
NULL
);
}
return
od
->
ring_buffer
->
push
((
uint8_t
*
)
chunk
,
size
);
}
static
unsigned
osx_output_delay
(
AudioOutput
*
ao
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
return
od
->
ring_buffer
->
write_available
()
?
0
:
25
;
}
const
struct
AudioOutputPlugin
osx_output_plugin
=
{
"osx"
,
osx_output_test_default_device
,
...
...
@@ -758,7 +759,7 @@ const struct AudioOutputPlugin osx_output_plugin = {
osx_output_disable
,
osx_output_open
,
osx_output_close
,
nullptr
,
osx_output_delay
,
nullptr
,
osx_output_play
,
nullptr
,
...
...
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