From: = <4265913+mikebrady@users.noreply.github.com> Date: Sat, 19 Nov 2022 09:05:26 +0000 (+0000) Subject: Fix a bug in audio_alsa.c when there is no hardware device name. X-Git-Tag: 4.1.1~2^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b03f237952391c2ef8400adef11c7c39911d417;p=thirdparty%2Fshairport-sync.git Fix a bug in audio_alsa.c when there is no hardware device name. --- diff --git a/audio_alsa.c b/audio_alsa.c index 62db843f..9a37f3f6 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -189,7 +189,9 @@ static int precision_delay_available() { // this is very crude -- if the device is a hardware device, then it's assumed the delay is // precise const char *output_device_name = snd_pcm_name(alsa_handle); - int is_a_real_hardware_device = (strstr(output_device_name, "hw:") == output_device_name); + int is_a_real_hardware_device = 0; + if (output_device_name != NULL) + is_a_real_hardware_device = (strstr(output_device_name, "hw:") == output_device_name); // The criteria as to whether precision delay is available // is whether the device driver returns non-zero update timestamps