output/alsa: add #ifdef ENABLE_DSD
Fixes the --disable-dsd build. See http://bugs.musicpd.org/view.php?id=4498
This commit is contained in:
parent
5628dcf47e
commit
111528e51c
@ -67,12 +67,14 @@ struct AlsaOutput {
|
|||||||
/** use memory mapped I/O? */
|
/** use memory mapped I/O? */
|
||||||
bool use_mmap;
|
bool use_mmap;
|
||||||
|
|
||||||
|
#ifdef ENABLE_DSD
|
||||||
/**
|
/**
|
||||||
* Enable DSD over PCM according to the DoP standard standard?
|
* Enable DSD over PCM according to the DoP standard standard?
|
||||||
*
|
*
|
||||||
* @see http://dsd-guide.com/dop-open-standard
|
* @see http://dsd-guide.com/dop-open-standard
|
||||||
*/
|
*/
|
||||||
bool dop;
|
bool dop;
|
||||||
|
#endif
|
||||||
|
|
||||||
/** libasound's buffer_time setting (in microseconds) */
|
/** libasound's buffer_time setting (in microseconds) */
|
||||||
unsigned int buffer_time;
|
unsigned int buffer_time;
|
||||||
@ -161,9 +163,12 @@ struct AlsaOutput {
|
|||||||
void Cancel();
|
void Cancel();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#ifdef ENABLE_DSD
|
||||||
bool SetupDop(AudioFormat audio_format,
|
bool SetupDop(AudioFormat audio_format,
|
||||||
PcmExport::Params ¶ms,
|
PcmExport::Params ¶ms,
|
||||||
Error &error);
|
Error &error);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool SetupOrDop(AudioFormat &audio_format, Error &error);
|
bool SetupOrDop(AudioFormat &audio_format, Error &error);
|
||||||
|
|
||||||
int Recover(int err);
|
int Recover(int err);
|
||||||
@ -189,9 +194,11 @@ AlsaOutput::Configure(const ConfigBlock &block, Error &error)
|
|||||||
|
|
||||||
use_mmap = block.GetBlockValue("use_mmap", false);
|
use_mmap = block.GetBlockValue("use_mmap", false);
|
||||||
|
|
||||||
|
#ifdef ENABLE_DSD
|
||||||
dop = block.GetBlockValue("dop", false) ||
|
dop = block.GetBlockValue("dop", false) ||
|
||||||
/* legacy name from MPD 0.18 and older: */
|
/* legacy name from MPD 0.18 and older: */
|
||||||
block.GetBlockValue("dsd_usb", false);
|
block.GetBlockValue("dsd_usb", false);
|
||||||
|
#endif
|
||||||
|
|
||||||
buffer_time = block.GetBlockValue("buffer_time",
|
buffer_time = block.GetBlockValue("buffer_time",
|
||||||
MPD_ALSA_BUFFER_TIME_US);
|
MPD_ALSA_BUFFER_TIME_US);
|
||||||
@ -672,6 +679,8 @@ error:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_DSD
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
AlsaOutput::SetupDop(const AudioFormat audio_format,
|
AlsaOutput::SetupDop(const AudioFormat audio_format,
|
||||||
PcmExport::Params ¶ms,
|
PcmExport::Params ¶ms,
|
||||||
@ -713,16 +722,25 @@ AlsaOutput::SetupDop(const AudioFormat audio_format,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
AlsaOutput::SetupOrDop(AudioFormat &audio_format, Error &error)
|
AlsaOutput::SetupOrDop(AudioFormat &audio_format, Error &error)
|
||||||
{
|
{
|
||||||
PcmExport::Params params;
|
PcmExport::Params params;
|
||||||
params.alsa_channel_order = true;
|
params.alsa_channel_order = true;
|
||||||
|
|
||||||
|
#ifdef ENABLE_DSD
|
||||||
params.dop = dop && audio_format.format == SampleFormat::DSD;
|
params.dop = dop && audio_format.format == SampleFormat::DSD;
|
||||||
const bool success = params.dop
|
#endif
|
||||||
|
|
||||||
|
const bool success =
|
||||||
|
#ifdef ENABLE_DSD
|
||||||
|
params.dop
|
||||||
? SetupDop(audio_format, params, error)
|
? SetupDop(audio_format, params, error)
|
||||||
: alsa_setup(this, audio_format, params, error);
|
:
|
||||||
|
#endif
|
||||||
|
alsa_setup(this, audio_format, params, error);
|
||||||
if (!success)
|
if (!success)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user