From 8aa61e230c49451cfb9d53505b0b1397d38412a1 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Wed, 22 Jun 2016 09:57:26 +0100 Subject: [PATCH] sndio: Add option to select output device --- src/output/plugins/SndioOutputPlugin.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index ce8ef6126..d3cfedcd6 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -40,13 +40,14 @@ class SndioOutput { friend struct AudioOutputWrapper; AudioOutput base; + const char *device; struct sio_hdl *sio_hdl; Timer *timer; public: SndioOutput() :base(sndio_output_plugin), - sio_hdl(nullptr) {} + device(nullptr), sio_hdl(nullptr) {} ~SndioOutput() {} bool Configure(const ConfigBlock &block, Error &error); @@ -67,6 +68,7 @@ SndioOutput::Configure(const ConfigBlock &block, Error &error) { if (!base.Configure(block, error)) return false; + device = block.GetBlockValue("device", SIO_DEVANY); return true; } @@ -105,7 +107,7 @@ SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error) struct sio_par par; unsigned bits, rate, chans; - sio_hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0); + sio_hdl = sio_open(device, SIO_PLAY, 0); if (!sio_hdl) { error.Format(sndio_output_domain, -1, "Failed to open default sndio device");