From 37a7ca7f14194d1b20c7a981a1fc2e864986cbd5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 15 Aug 2016 10:00:03 +0200 Subject: [PATCH 1/5] configure.ac: prepare for 0.19.19 --- NEWS | 2 ++ configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index f49028293..9a7a69ec9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.19.19 (not yet released) + ver 0.19.18 (2016/08/05) * decoder - ffmpeg: fix crash with older FFmpeg versions (< 3.0) diff --git a/configure.ac b/configure.ac index 1a3a20c12..e4764c923 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.19.18, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.19.19, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 VERSION_MINOR=19 -VERSION_REVISION=18 +VERSION_REVISION=19 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/Main.cxx]) From ac49043fbb4572f1262fea594bbd922b58b1863c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 15 Aug 2016 10:02:22 +0200 Subject: [PATCH 2/5] output/pulse: move variable declaration down --- src/output/plugins/PulseOutputPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index 120bad090..a9a84bc24 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -545,7 +545,6 @@ pulse_output_open(AudioOutput *ao, AudioFormat &audio_format, Error &error) { PulseOutput *po = (PulseOutput *)ao; - pa_sample_spec ss; assert(po->mainloop != nullptr); @@ -579,6 +578,7 @@ pulse_output_open(AudioOutput *ao, AudioFormat &audio_format, we just force MPD to send us everything as 16 bit */ audio_format.format = SampleFormat::S16; + pa_sample_spec ss; ss.format = PA_SAMPLE_S16NE; ss.rate = audio_format.sample_rate; ss.channels = audio_format.channels; From 62000670e3b574cf7fd761ee081693735781e768 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 14 Aug 2016 18:45:32 +0200 Subject: [PATCH 3/5] Support S24_P32/S32/FLOAT sample formats on Pulse This is based on a patch from Ian Scott in 2014. It was never committed, so I figured I'd fix the outstanding issue and resubmit it. https://www.mail-archive.com/mpd-devel%40musicpd.org/msg00139.html --- NEWS | 2 ++ src/output/plugins/PulseOutputPlugin.cxx | 26 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 9a7a69ec9..9b9ceadef 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.19.19 (not yet released) +* output + - pulse: support 32 bit, 24 bit and floating point playback ver 0.19.18 (2016/08/05) * decoder diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index a9a84bc24..230114559 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -574,12 +574,30 @@ pulse_output_open(AudioOutput *ao, AudioFormat &audio_format, 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; - ss.format = PA_SAMPLE_S16NE; + + 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.rate = audio_format.sample_rate; ss.channels = audio_format.channels; From 25deae6cc7cb49ee02278509c7904d3efc69a00b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 15 Aug 2016 10:07:08 +0200 Subject: [PATCH 4/5] decoder/wildmidi: move code to wildmidi_output() --- src/decoder/plugins/WildmidiDecoderPlugin.cxx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/decoder/plugins/WildmidiDecoderPlugin.cxx b/src/decoder/plugins/WildmidiDecoderPlugin.cxx index fc58f0977..1c18860b4 100644 --- a/src/decoder/plugins/WildmidiDecoderPlugin.cxx +++ b/src/decoder/plugins/WildmidiDecoderPlugin.cxx @@ -65,6 +65,17 @@ wildmidi_finish(void) WildMidi_Shutdown(); } +static DecoderCommand +wildmidi_output(Decoder &decoder, midi *wm) +{ + char buffer[4096]; + 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 +105,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 = From a546bfe7d998274bf936225aa89b05cd46cb0888 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 15 Aug 2016 10:08:35 +0200 Subject: [PATCH 5/5] decoder/wildmidi: support libWildMidi 0.4 --- NEWS | 2 ++ src/decoder/plugins/WildmidiDecoderPlugin.cxx | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 9b9ceadef..5ab83d1e7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.19.19 (not yet released) +* decoder + - wildmidi: support libWildMidi 0.4 * output - pulse: support 32 bit, 24 bit and floating point playback diff --git a/src/decoder/plugins/WildmidiDecoderPlugin.cxx b/src/decoder/plugins/WildmidiDecoderPlugin.cxx index 1c18860b4..e5dbabe46 100644 --- a/src/decoder/plugins/WildmidiDecoderPlugin.cxx +++ b/src/decoder/plugins/WildmidiDecoderPlugin.cxx @@ -68,7 +68,14 @@ wildmidi_finish(void) 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;