From 4a47265224cf1182445363ddcf4c1e2491503da6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 27 Feb 2016 07:34:58 +0100 Subject: [PATCH] output/alsa: pass PcmExport::Params to SetupDop() --- src/output/plugins/AlsaOutputPlugin.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index c051517cf..0761ae361 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -162,7 +162,7 @@ struct AlsaOutput { private: bool SetupDop(AudioFormat audio_format, - bool *shift8_r, bool *packed_r, bool *reverse_endian_r, + PcmExport::Params ¶ms, Error &error); bool SetupOrDop(AudioFormat &audio_format, Error &error); @@ -674,7 +674,7 @@ error: inline bool AlsaOutput::SetupDop(const AudioFormat audio_format, - bool *shift8_r, bool *packed_r, bool *reverse_endian_r, + PcmExport::Params ¶ms, Error &error) { assert(dop); @@ -688,7 +688,8 @@ AlsaOutput::SetupDop(const AudioFormat audio_format, const AudioFormat check = dop_format; - if (!alsa_setup(this, dop_format, packed_r, reverse_endian_r, error)) + if (!alsa_setup(this, dop_format, ¶ms.pack24, + ¶ms.reverse_endian, error)) return false; /* if the device allows only 32 bit, shift all DoP @@ -696,7 +697,7 @@ AlsaOutput::SetupDop(const AudioFormat audio_format, the DSD-over-USB documentation does not specify whether this is legal, but there is anecdotical evidence that this is possible (and the only option for some devices) */ - *shift8_r = dop_format.format == SampleFormat::S32; + params.shift8 = dop_format.format == SampleFormat::S32; if (dop_format.format == SampleFormat::S32) dop_format.format = SampleFormat::S24_P32; @@ -721,10 +722,7 @@ AlsaOutput::SetupOrDop(AudioFormat &audio_format, Error &error) params.dop = dop && audio_format.format == SampleFormat::DSD; const bool success = params.dop - ? SetupDop(audio_format, - ¶ms.shift8, - ¶ms.pack24, ¶ms.reverse_endian, - error) + ? SetupDop(audio_format, params, error) : alsa_setup(this, audio_format, ¶ms.pack24, ¶ms.reverse_endian, error);