output/jack: enable on Windows

This enables the JACK output plugin on Windows, but doesn't link
against libjack64.dll, instead loads the DLL at runtime with
LoadLibrary().  This kludge avoids the extremely fragile JACK shared
memory protocol by using the system's libjack64.dll, without requiring
the same DLL at build time.
This commit is contained in:
Max Kellermann
2021-04-07 17:29:58 +02:00
parent b885f358a5
commit 0f02bbc2fe
7 changed files with 250 additions and 0 deletions

View File

@@ -44,6 +44,10 @@ static constexpr unsigned MAX_PORTS = 16;
static constexpr size_t jack_sample_size = sizeof(jack_default_audio_sample_t);
#ifdef DYNAMIC_JACK
#include "lib/jack/Dynamic.hxx"
#endif // _WIN32
class JackOutput final : public AudioOutput {
/**
* libjack options passed to jack_client_open().
@@ -463,6 +467,10 @@ JackOutput::Disable() noexcept
static AudioOutput *
mpd_jack_init(EventLoop &, const ConfigBlock &block)
{
#ifdef DYNAMIC_JACK
LoadJackLibrary();
#endif
jack_set_error_function(mpd_jack_error);
#ifdef HAVE_JACK_SET_INFO_FUNCTION