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
a37d22de
Commit
a37d22de
authored
Jan 17, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Convert: choose pcm2dsd float/integer according to dest_format
parent
452e1c1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
NEWS
NEWS
+1
-0
Convert.cxx
src/pcm/Convert.cxx
+8
-3
Convert.hxx
src/pcm/Convert.hxx
+4
-0
No files found.
NEWS
View file @
a37d22de
...
@@ -22,6 +22,7 @@ ver 0.22 (not yet released)
...
@@ -22,6 +22,7 @@ ver 0.22 (not yet released)
- ffmpeg: new plugin based on FFmpeg's libavfilter library
- ffmpeg: new plugin based on FFmpeg's libavfilter library
- hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback
- hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback
- volume: convert S16 to S24 to preserve quality and reduce dithering noise
- volume: convert S16 to S24 to preserve quality and reduce dithering noise
- dsd: add integer-only DSD to PCM converter
* output
* output
- jack: add option "auto_destination_ports"
- jack: add option "auto_destination_ports"
- jack: report error details
- jack: report error details
...
...
src/pcm/Convert.cxx
View file @
a37d22de
...
@@ -41,7 +41,10 @@ PcmConvert::PcmConvert(const AudioFormat _src_format,
...
@@ -41,7 +41,10 @@ PcmConvert::PcmConvert(const AudioFormat _src_format,
AudioFormat
format
=
_src_format
;
AudioFormat
format
=
_src_format
;
if
(
format
.
format
==
SampleFormat
::
DSD
)
{
if
(
format
.
format
==
SampleFormat
::
DSD
)
{
#ifdef ENABLE_DSD
#ifdef ENABLE_DSD
format
.
format
=
SampleFormat
::
FLOAT
;
dsd2pcm_float
=
dest_format
.
format
==
SampleFormat
::
FLOAT
;
format
.
format
=
dsd2pcm_float
?
SampleFormat
::
FLOAT
:
SampleFormat
::
S24_P32
;
#else
#else
throw
std
::
runtime_error
(
"DSD support is disabled"
);
throw
std
::
runtime_error
(
"DSD support is disabled"
);
#endif
#endif
...
@@ -115,11 +118,13 @@ PcmConvert::Convert(ConstBuffer<void> buffer)
...
@@ -115,11 +118,13 @@ PcmConvert::Convert(ConstBuffer<void> buffer)
#ifdef ENABLE_DSD
#ifdef ENABLE_DSD
if
(
src_format
.
format
==
SampleFormat
::
DSD
)
{
if
(
src_format
.
format
==
SampleFormat
::
DSD
)
{
auto
s
=
ConstBuffer
<
uint8_t
>::
FromVoid
(
buffer
);
auto
s
=
ConstBuffer
<
uint8_t
>::
FromVoid
(
buffer
);
auto
d
=
dsd
.
ToFloat
(
src_format
.
channels
,
s
);
auto
d
=
dsd2pcm_float
?
dsd
.
ToFloat
(
src_format
.
channels
,
s
).
ToVoid
()
:
dsd
.
ToS24
(
src_format
.
channels
,
s
).
ToVoid
();
if
(
d
.
IsNull
())
if
(
d
.
IsNull
())
throw
std
::
runtime_error
(
"DSD to PCM conversion failed"
);
throw
std
::
runtime_error
(
"DSD to PCM conversion failed"
);
buffer
=
d
.
ToVoid
()
;
buffer
=
d
;
}
}
#endif
#endif
...
...
src/pcm/Convert.hxx
View file @
a37d22de
...
@@ -51,6 +51,10 @@ class PcmConvert {
...
@@ -51,6 +51,10 @@ class PcmConvert {
bool
enable_resampler
,
enable_format
,
enable_channels
;
bool
enable_resampler
,
enable_format
,
enable_channels
;
#ifdef ENABLE_DSD
bool
dsd2pcm_float
;
#endif
public
:
public
:
/**
/**
...
...
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