diff --git a/NEWS b/NEWS index 68729891e..4052ebe41 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ ver 0.23.10 (not yet released) - ffmpeg: fix libfmt 9 compiler warning * encoder - flac: fix failure when libFLAC is built without Ogg support +* output + - alsa: fix crash bug * Windows - log to stdout by default, don't require "log_file" setting diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index eebd47540..19e57b4dd 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -812,8 +812,12 @@ AlsaOutput::Open(AudioFormat &audio_format) fmt::format("Failed to open ALSA device \"{}\"", GetDevice()).c_str()); + const char *pcm_name = snd_pcm_name(pcm); + if (pcm_name == nullptr) + pcm_name = "?"; + FmtDebug(alsa_output_domain, "opened {} type={}", - snd_pcm_name(pcm), + pcm_name, snd_pcm_type_name(snd_pcm_type(pcm))); #ifdef ENABLE_DSD