Date: Fri, 03 Apr 2020 18:08:33 +0000 From: bugzilla-noreply@freebsd.org To: gnome@FreeBSD.org Subject: [Bug 245156] audio/pulseaudio: parse /dev/sndstat correctly to get device name Message-ID: <bug-245156-6497-1sj1e1OXyI@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-245156-6497@https.bugs.freebsd.org/bugzilla/> References: <bug-245156-6497@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D245156 --- Comment #15 from lightside <lightside@gmx.com> --- Created attachment 213025 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D213025&action= =3Dedit Testcase 2 Hello, Greg V. (In reply to Greg V from comment #14) > I've included a solution for this that hopefully doesn't break Linux OSS = or > other BSDs (?), and does not use VLAs (variable-length arrays, which are = not > standard C) like `char desc[len + 1]` in attachment 213006 Probably you are right, if VLAs is optional in C11, and PulseAudio changed used C standard from C99 to C11: https://github.com/pulseaudio/pulseaudio/blob/9562e898ddbfe61b29a9914cb7378= bb0f01cc527/NEWS#L265 Changed the C standard from C99 to C11. https://github.com/pulseaudio/pulseaudio/blob/v13.0/configure.ac#L172 AX_CHECK_COMPILE_FLAG([-std=3Dgnu11], But it compiled ok with using base Clang compiler on FreeBSD, in my case. (In reply to Greg V from comment #14) > I'm working on an upstream merge request: > https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277 As about your proposed code for upstreaming, the strcspn function doesn't search in reverse for '>' character. Maybe this is not so important, but attached testcase may show this for "Testcase 1" and how I tried to fix it = with using strrchr function in "Testcase 2": -8<-- char line[] =3D "pcm4: <Realtek (0x1168) (Rear Analog 5.1/2.0)> (play/rec) default"; Testcase 1: 4 - Realtek (0x1168) (Rear Analog 5.1/2.0) Testcase 2: 4 - Realtek (0x1168) (Rear Analog 5.1/2.0) char line[] =3D "pcm4: <Realtek (0x1168) <#> (Rear Analog 5.1/2.0)> (play/r= ec) default"; Testcase 1: 4 - Realtek (0x1168) <# Testcase 2: 4 - Realtek (0x1168) <#> (Rear Analog 5.1/2.0) -->8- --=20 You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-245156-6497-1sj1e1OXyI>