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
9835a254
Commit
9835a254
authored
Aug 06, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not assume two pops are enough
parent
c28cefee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
OSXOutputPlugin.cxx
src/output/plugins/OSXOutputPlugin.cxx
+5
-5
No files found.
src/output/plugins/OSXOutputPlugin.cxx
View file @
9835a254
...
...
@@ -410,18 +410,18 @@ osx_render(void *vdata,
requested_bytes
=
od
->
render_buffer_size
;
size_t
available_bytes
=
od
->
ring_buffer
->
pop
(
od
->
render_buffer
,
requested_bytes
);
size_t
wraparound_remainder
=
available_bytes
%
input_buffer_frame_size
;
/*
Maybe this is paranoid but we have no way of knowing
if the 'pop' above ended at a frame boundary. In case
of an incomplete last frame,
do a second pop to get
enough bytes to complete the last fram
e.
of an incomplete last frame,
keep popping until the
last frame is complet
e.
*/
if
(
wraparound_remainder
>
0
)
size_t
remainder
;
while
((
remainder
=
available_bytes
%
input_buffer_frame_size
)
>
0
)
available_bytes
+=
od
->
ring_buffer
->
pop
(
od
->
render_buffer
+
available_bytes
,
input_buffer_frame_size
-
wraparound_
remainder
input_buffer_frame_size
-
remainder
);
od
->
condition
.
signal
();
// We are done consuming from ring_buffer
...
...
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