output/alsa: pass PcmExport::Params to SetupDop()

This commit is contained in:
Max Kellermann 2016-02-27 07:34:58 +01:00
parent f0f3017a76
commit 4a47265224

View File

@ -162,7 +162,7 @@ struct AlsaOutput {
private: private:
bool SetupDop(AudioFormat audio_format, bool SetupDop(AudioFormat audio_format,
bool *shift8_r, bool *packed_r, bool *reverse_endian_r, PcmExport::Params &params,
Error &error); Error &error);
bool SetupOrDop(AudioFormat &audio_format, Error &error); bool SetupOrDop(AudioFormat &audio_format, Error &error);
@ -674,7 +674,7 @@ error:
inline bool inline bool
AlsaOutput::SetupDop(const AudioFormat audio_format, AlsaOutput::SetupDop(const AudioFormat audio_format,
bool *shift8_r, bool *packed_r, bool *reverse_endian_r, PcmExport::Params &params,
Error &error) Error &error)
{ {
assert(dop); assert(dop);
@ -688,7 +688,8 @@ AlsaOutput::SetupDop(const AudioFormat audio_format,
const AudioFormat check = dop_format; const AudioFormat check = dop_format;
if (!alsa_setup(this, dop_format, packed_r, reverse_endian_r, error)) if (!alsa_setup(this, dop_format, &params.pack24,
&params.reverse_endian, error))
return false; return false;
/* if the device allows only 32 bit, shift all DoP /* 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 the DSD-over-USB documentation does not specify whether
this is legal, but there is anecdotical evidence that this this is legal, but there is anecdotical evidence that this
is possible (and the only option for some devices) */ 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) if (dop_format.format == SampleFormat::S32)
dop_format.format = SampleFormat::S24_P32; 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; params.dop = dop && audio_format.format == SampleFormat::DSD;
const bool success = params.dop const bool success = params.dop
? SetupDop(audio_format, ? SetupDop(audio_format, params, error)
&params.shift8,
&params.pack24, &params.reverse_endian,
error)
: alsa_setup(this, audio_format, : alsa_setup(this, audio_format,
&params.pack24, &params.reverse_endian, &params.pack24, &params.reverse_endian,
error); error);