From 2fdb27d85129901b3ec01927ce5cb266c0d94563 Mon Sep 17 00:00:00 2001 From: sin <s...@2f30.org> Date: Wed, 22 Jun 2016 09:49:06 +0100 Subject: [PATCH 2/2] sndio: Implement sndio_test_default_device()
--- src/output/plugins/SndioOutputPlugin.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index 12a161e..dfa7bb2 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -84,6 +84,22 @@ SndioOutput::Create(const ConfigBlock &block, Error &error) return ao; } +static bool +sndio_test_default_device() +{ + struct sio_hdl *sio_hdl; + + sio_hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0); + if (!sio_hdl) { + FormatError(sndio_output_domain, + "Error opening default sndio device"); + return false; + } + + sio_close(sio_hdl); + return true; +} + bool SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error) { @@ -199,7 +215,7 @@ typedef AudioOutputWrapper<SndioOutput> Wrapper; const struct AudioOutputPlugin sndio_output_plugin = { "sndio", - nullptr, + sndio_test_default_device, &Wrapper::Init, &Wrapper::Finish, nullptr, -- 2.8.4 _______________________________________________ mpd-devel mailing list mpd-devel@musicpd.org http://mailman.blarg.de/listinfo/mpd-devel