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
cc0dbcf3
Commit
cc0dbcf3
authored
Jan 11, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Dsd32: fix the byte order
The byte order of DSD_U32 was wrong from the start. The oldest bits must be in the MSB, not in the LSB, according to snd_pcm_format_descriptions in alsa-lib.
parent
c5a2cadc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
NEWS
NEWS
+1
-0
Dsd32.cxx
src/pcm/Dsd32.cxx
+5
-2
Dsd32.hxx
src/pcm/Dsd32.hxx
+1
-1
No files found.
NEWS
View file @
cc0dbcf3
...
...
@@ -5,6 +5,7 @@ ver 0.20.2 (not yet released)
- libsamplerate: reset state after seeking
* output
- alsa: fix the DSD_U32 sample rate
- alsa: fix the DSD_U32 byte order
ver 0.20.1 (2017/01/09)
* input
...
...
src/pcm/Dsd32.cxx
View file @
cc0dbcf3
...
...
@@ -29,8 +29,11 @@
static
constexpr
inline
uint32_t
Construct32
(
uint8_t
a
,
uint8_t
b
,
uint8_t
c
,
uint8_t
d
)
{
return
uint32_t
(
a
)
|
(
uint32_t
(
b
)
<<
8
)
|
(
uint32_t
(
c
)
<<
16
)
|
(
uint32_t
(
d
)
<<
24
);
/* "a" is the oldest byte, which must be in the most
significant byte */
return
uint32_t
(
d
)
|
(
uint32_t
(
c
)
<<
8
)
|
(
uint32_t
(
b
)
<<
16
)
|
(
uint32_t
(
a
)
<<
24
);
}
static
constexpr
inline
uint32_t
...
...
src/pcm/Dsd32.hxx
View file @
cc0dbcf3
...
...
@@ -28,7 +28,7 @@ template<typename T> struct ConstBuffer;
class
PcmBuffer
;
/**
* Convert DSD_U8 to DSD_U32 (native endian).
* Convert DSD_U8 to DSD_U32 (native endian
, oldest bits in MSB
).
*/
ConstBuffer
<
uint32_t
>
Dsd8To32
(
PcmBuffer
&
buffer
,
unsigned
channels
,
ConstBuffer
<
uint8_t
>
src
);
...
...
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