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
d271dd2c
Commit
d271dd2c
authored
Mar 27, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/alsa: use pcm_export for the DSD-over-USB conversion
parent
ebfdd374
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
alsa_output_plugin.c
src/output/alsa_output_plugin.c
+10
-11
No files found.
src/output/alsa_output_plugin.c
View file @
d271dd2c
...
...
@@ -595,15 +595,16 @@ alsa_setup_dsd(struct alsa_data *ad, struct audio_format *audio_format,
/* pass 24 bit to alsa_setup() */
audio_format
->
format
=
SAMPLE_FORMAT_S24_P32
;
audio_format
->
sample_rate
/=
2
;
struct
audio_format
usb_format
=
*
audio_format
;
usb_format
.
format
=
SAMPLE_FORMAT_S24_P32
;
usb_format
.
sample_rate
/=
2
;
const
struct
audio_format
check
=
*
audio
_format
;
const
struct
audio_format
check
=
usb
_format
;
if
(
!
alsa_setup
(
ad
,
audio
_format
,
packed_r
,
reverse_endian_r
,
error_r
))
if
(
!
alsa_setup
(
ad
,
&
usb
_format
,
packed_r
,
reverse_endian_r
,
error_r
))
return
false
;
if
(
!
audio_format_equals
(
audio
_format
,
&
check
))
{
if
(
!
audio_format_equals
(
&
usb
_format
,
&
check
))
{
/* no bit-perfect playback, which is required
for DSD over USB */
g_set_error
(
error_r
,
alsa_output_quark
(),
0
,
...
...
@@ -612,10 +613,6 @@ alsa_setup_dsd(struct alsa_data *ad, struct audio_format *audio_format,
return
false
;
}
/* the ALSA device has accepted 24 bit playback,
return DSD_OVER_USB to the caller */
audio_format
->
format
=
SAMPLE_FORMAT_DSD_OVER_USB
;
return
true
;
}
...
...
@@ -625,7 +622,9 @@ alsa_setup_or_dsd(struct alsa_data *ad, struct audio_format *audio_format,
{
bool
packed
,
reverse_endian
;
const
bool
success
=
ad
->
dsd_usb
&&
audio_format
->
format
==
SAMPLE_FORMAT_DSD
const
bool
dsd_usb
=
ad
->
dsd_usb
&&
audio_format
->
format
==
SAMPLE_FORMAT_DSD
;
const
bool
success
=
dsd_usb
?
alsa_setup_dsd
(
ad
,
audio_format
,
&
packed
,
&
reverse_endian
,
error_r
)
:
alsa_setup
(
ad
,
audio_format
,
&
packed
,
&
reverse_endian
,
...
...
@@ -635,7 +634,7 @@ alsa_setup_or_dsd(struct alsa_data *ad, struct audio_format *audio_format,
pcm_export_open
(
&
ad
->
export
,
audio_format
->
format
,
audio_format
->
channels
,
false
,
packed
,
reverse_endian
);
dsd_usb
,
packed
,
reverse_endian
);
return
true
;
}
...
...
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