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
6fed6e50
Commit
6fed6e50
authored
5 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/osx: merge some duplicate code
parent
bc9e0748
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
OSXOutputPlugin.cxx
src/output/plugins/OSXOutputPlugin.cxx
+14
-6
No files found.
src/output/plugins/OSXOutputPlugin.cxx
View file @
6fed6e50
...
@@ -776,23 +776,31 @@ OSXOutput::Play(const void *chunk, size_t size)
...
@@ -776,23 +776,31 @@ OSXOutput::Play(const void *chunk, size_t size)
started
=
true
;
started
=
true
;
}
}
ConstBuffer
<
uint8_t
>
input
((
const
uint8_t
*
)
chunk
,
size
);
#ifdef ENABLE_DSD
#ifdef ENABLE_DSD
if
(
dop_enabled
)
{
if
(
dop_enabled
)
{
const
auto
e
=
pcm_export
->
Export
({
chunk
,
size
}
);
input
=
ConstBuffer
<
uint8_t
>::
FromVoid
(
pcm_export
->
Export
(
input
.
ToVoid
())
);
/* the DoP (DSD over PCM) filter converts two frames
/* the DoP (DSD over PCM) filter converts two frames
at a time and ignores the last odd frame; if there
at a time and ignores the last odd frame; if there
was only one frame (e.g. the last frame in the
was only one frame (e.g. the last frame in the
file), the result is empty; to avoid an endless
file), the result is empty; to avoid an endless
loop, bail out here, and pretend the one frame has
loop, bail out here, and pretend the one frame has
been played */
been played */
if
(
e
.
empty
())
if
(
input
.
empty
())
return
size
;
return
size
;
size_t
bytes_written
=
ring_buffer
->
push
((
const
uint8_t
*
)
e
.
data
,
e
.
size
);
return
pcm_export
->
CalcSourceSize
(
bytes_written
);
}
}
#endif
#endif
return
ring_buffer
->
push
((
const
uint8_t
*
)
chunk
,
size
);
size_t
bytes_written
=
ring_buffer
->
push
(
input
.
data
,
input
.
size
);
#ifdef ENABLE_DSD
if
(
dop_enabled
)
bytes_written
=
pcm_export
->
CalcSourceSize
(
bytes_written
);
#endif
return
bytes_written
;
}
}
std
::
chrono
::
steady_clock
::
duration
std
::
chrono
::
steady_clock
::
duration
...
...
This diff is collapsed.
Click to expand it.
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