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
743fa73a
Commit
743fa73a
authored
Aug 15, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.19.x'
parents
4d6192ad
a546bfe7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
11 deletions
+47
-11
NEWS
NEWS
+6
-0
WildmidiDecoderPlugin.cxx
src/decoder/plugins/WildmidiDecoderPlugin.cxx
+19
-8
PulseOutputPlugin.cxx
src/output/plugins/PulseOutputPlugin.cxx
+22
-3
No files found.
NEWS
View file @
743fa73a
...
...
@@ -54,6 +54,12 @@ ver 0.20 (not yet released)
* update
- apply .mpdignore matches to subdirectories
ver 0.19.19 (not yet released)
* decoder
- wildmidi: support libWildMidi 0.4
* output
- pulse: support 32 bit, 24 bit and floating point playback
ver 0.19.18 (2016/08/05)
* decoder
- ffmpeg: fix crash with older FFmpeg versions (< 3.0)
...
...
src/decoder/plugins/WildmidiDecoderPlugin.cxx
View file @
743fa73a
...
...
@@ -65,6 +65,24 @@ wildmidi_finish(void)
WildMidi_Shutdown
();
}
static
DecoderCommand
wildmidi_output
(
Decoder
&
decoder
,
midi
*
wm
)
{
#ifdef LIBWILDMIDI_VER_MAJOR
/* WildMidi 0.4 has switched from "char*" to "int8_t*" */
int8_t
buffer
[
4096
];
#else
/* pre 0.4 */
char
buffer
[
4096
];
#endif
int
length
=
WildMidi_GetOutput
(
wm
,
buffer
,
sizeof
(
buffer
));
if
(
length
<=
0
)
return
DecoderCommand
::
STOP
;
return
decoder_data
(
decoder
,
nullptr
,
buffer
,
length
,
0
);
}
static
void
wildmidi_file_decode
(
Decoder
&
decoder
,
Path
path_fs
)
{
...
...
@@ -94,18 +112,11 @@ wildmidi_file_decode(Decoder &decoder, Path path_fs)
DecoderCommand
cmd
;
do
{
char
buffer
[
4096
];
int
len
;
info
=
WildMidi_GetInfo
(
wm
);
if
(
info
==
nullptr
)
break
;
len
=
WildMidi_GetOutput
(
wm
,
buffer
,
sizeof
(
buffer
));
if
(
len
<=
0
)
break
;
cmd
=
decoder_data
(
decoder
,
nullptr
,
buffer
,
len
,
0
);
cmd
=
wildmidi_output
(
decoder
,
wm
);
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
unsigned
long
seek_where
=
...
...
src/output/plugins/PulseOutputPlugin.cxx
View file @
743fa73a
...
...
@@ -679,11 +679,30 @@ PulseOutput::Open(AudioFormat &audio_format, Error &error)
return
false
;
}
/* MPD doesn't support the other pulseaudio sample formats, so
we just force MPD to send us everything as 16 bit */
audio_format
.
format
=
SampleFormat
::
S16
;
/* Use the sample formats that our version of PulseAudio and MPD
have in common, otherwise force MPD to send 16 bit */
pa_sample_spec
ss
;
switch
(
audio_format
.
format
)
{
case
SampleFormat
:
:
FLOAT
:
ss
.
format
=
PA_SAMPLE_FLOAT32NE
;
break
;
case
SampleFormat
:
:
S32
:
ss
.
format
=
PA_SAMPLE_S32NE
;
break
;
case
SampleFormat
:
:
S24_P32
:
ss
.
format
=
PA_SAMPLE_S24_32NE
;
break
;
case
SampleFormat
:
:
S16
:
ss
.
format
=
PA_SAMPLE_S16NE
;
break
;
default
:
audio_format
.
format
=
SampleFormat
::
S16
;
ss
.
format
=
PA_SAMPLE_S16NE
;
break
;
}
ss
.
format
=
PA_SAMPLE_S16NE
;
ss
.
rate
=
audio_format
.
sample_rate
;
ss
.
channels
=
audio_format
.
channels
;
...
...
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