pcm/Export: convert the DSD bools to an enum

These options are exclusive.
This commit is contained in:
Max Kellermann
2019-06-17 22:20:28 +02:00
parent c75dc4a647
commit 28e07e900f
6 changed files with 113 additions and 53 deletions

View File

@@ -95,8 +95,7 @@ TryFormatDsd(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
#if defined(ENABLE_DSD) && defined(HAVE_ALSA_DSD_U32)
if (err == 0) {
params.dsd_u16 = false;
params.dsd_u32 = false;
params.dsd_mode = PcmExport::DsdMode::NONE;
}
if (err == -EINVAL && fmt == SND_PCM_FORMAT_DSD_U8) {
@@ -106,7 +105,7 @@ TryFormatDsd(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
: SND_PCM_FORMAT_DSD_U32_BE;
err = TryFormatOrByteSwap(pcm, hwparams, fmt, params);
if (err == 0)
params.dsd_u32 = true;
params.dsd_mode = PcmExport::DsdMode::U32;
else
fmt = SND_PCM_FORMAT_DSD_U8;
}
@@ -118,7 +117,7 @@ TryFormatDsd(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
: SND_PCM_FORMAT_DSD_U16_BE;
err = TryFormatOrByteSwap(pcm, hwparams, fmt, params);
if (err == 0)
params.dsd_u16 = true;
params.dsd_mode = PcmExport::DsdMode::U16;
else
fmt = SND_PCM_FORMAT_DSD_U8;
}