summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-02-28 10:15:02 +0100
committerMax Kellermann <max@duempel.org>2016-02-28 10:19:19 +0100
commit92f54f0b59e7f5c4041193e261b9280251dc67a2 (patch)
treee7bd489695698d3b346492987cbfc56e8a924fe8 /src/output
parentddce544b537b5f80721e8a4224e868ffa1f94a85 (diff)
output/alsa: disable DoP if it fails
See http://bugs.musicpd.org/view.php?id=4496
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/AlsaOutputPlugin.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx
index dcc0493fc..743f7f575 100644
--- a/src/output/plugins/AlsaOutputPlugin.cxx
+++ b/src/output/plugins/AlsaOutputPlugin.cxx
@@ -731,13 +731,25 @@ AlsaOutput::SetupOrDop(AudioFormat &audio_format, PcmExport::Params &params,
Error &error)
{
#ifdef ENABLE_DSD
- if (dop && audio_format.format == SampleFormat::DSD) {
+ Error dop_error;
+ if (dop && audio_format.format == SampleFormat::DSD &&
+ SetupDop(audio_format, params, dop_error)) {
params.dop = true;
- return SetupDop(audio_format, params, error);
+ return true;
}
#endif
- return AlsaSetup(this, audio_format, params, error);
+ if (AlsaSetup(this, audio_format, params, error))
+ return true;
+
+#ifdef ENABLE_DSD
+ if (dop_error.IsDefined())
+ /* if DoP was attempted, prefer returning the original
+ DoP error instead of the fallback error */
+ error = std::move(dop_error);
+#endif
+
+ return false;
}
inline bool