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
4c9782ee
Commit
4c9782ee
authored
Oct 10, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/pcm: support reverse byte order
parent
26225307
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
pcm_decoder_plugin.c
src/decoder/pcm_decoder_plugin.c
+21
-3
No files found.
src/decoder/pcm_decoder_plugin.c
View file @
4c9782ee
...
...
@@ -31,21 +31,35 @@
static
void
pcm_stream_decode
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
)
{
static
const
struct
audio_format
audio_format
=
{
static
const
struct
audio_format
host_
audio_format
=
{
.
sample_rate
=
44100
,
.
format
=
SAMPLE_FORMAT_S16
,
.
channels
=
2
,
};
static
const
struct
audio_format
reverse_audio_format
=
{
.
sample_rate
=
44100
,
.
format
=
SAMPLE_FORMAT_S16
,
.
channels
=
2
,
.
reverse_endian
=
true
,
};
const
struct
audio_format
*
audio_format
=
(
is
->
mime
==
NULL
||
strcmp
(
is
->
mime
,
"audio/x-mpd-cdda-pcm-reverse"
)
!=
0
)
?
&
host_audio_format
:
&
reverse_audio_format
;
GError
*
error
=
NULL
;
enum
decoder_command
cmd
;
double
time_to_size
=
audio_format_time_to_size
(
&
audio_format
);
double
time_to_size
=
audio_format_time_to_size
(
audio_format
);
float
total_time
=
-
1
;
if
(
is
->
size
>=
0
)
total_time
=
is
->
size
/
time_to_size
;
decoder_initialized
(
decoder
,
&
audio_format
,
is
->
seekable
,
total_time
);
decoder_initialized
(
decoder
,
audio_format
,
is
->
seekable
,
total_time
);
do
{
char
buffer
[
4096
];
...
...
@@ -80,6 +94,10 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
static
const
char
*
const
pcm_mime_types
[]
=
{
/* for streams obtained by the cdio_paranoia input plugin */
"audio/x-mpd-cdda-pcm"
,
/* same as above, but with reverse byte order */
"audio/x-mpd-cdda-pcm-reverse"
,
NULL
};
...
...
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