ladspa-sink-fix-search-path.patch (#1594568, fdo#107078)

This commit is contained in:
Rex Dieter 2018-07-05 13:42:02 -05:00
parent f434422554
commit 9e65cfde65
2 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,68 @@
From patchwork Wed Jul 4 11:25:26 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: ladspa-sink: fix search path
From: Tanu Kaskinen <tanuk@iki.fi>
X-Patchwork-Id: 236297
Message-Id: <20180704112526.31236-1-tanuk@iki.fi>
To: pulseaudio-discuss@lists.freedesktop.org
Date: Wed, 4 Jul 2018 14:25:26 +0300
Having a single level macro for stringizing LADSPA_PATH doesn't work,
because the '#' preprocessor operator doesn't expand any macros in its
parameter. As a result, we used the string "LADSPA_PATH" as the search
path, and obviously no plugins were ever found.
This adds a two-level macro in macro.h and uses that to expand and
stringize LADSPA_PATH.
Bug link: https://bugs.freedesktop.org/show_bug.cgi?id=107078
---
src/modules/module-ladspa-sink.c | 14 ++++++--------
src/pulsecore/macro.h | 6 ++++++
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index c654530a3..0bde922bf 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -1054,15 +1054,13 @@ int pa__init(pa_module*m) {
u->output = NULL;
u->ss = ss;
- /* If the LADSPA_PATH environment variable is not set, we use the
- * LADSPA_PATH preprocessor macro instead. The macro can contain characters
- * that need to be escaped (especially on Windows backslashes are common).
- * The "#" preprocessor operator helpfully adds the required escaping while
- * turning the LADSPA_PATH macro into a string. */
-#define QUOTE_MACRO(x) #x
if (!(e = getenv("LADSPA_PATH")))
- e = QUOTE_MACRO(LADSPA_PATH);
-#undef QUOTE_MACRO
+ /* The LADSPA_PATH preprocessor macro isn't a string literal (i.e. it
+ * doesn't contain quotes), because otherwise the build system would
+ * have an extra burden of getting the escaping right (Windows paths
+ * are especially tricky). PA_EXPAND_AND_STRINGIZE does the necessary
+ * escaping. */
+ e = PA_EXPAND_AND_STRINGIZE(LADSPA_PATH);
/* FIXME: This is not exactly thread safe */
t = pa_xstrdup(lt_dlgetsearchpath());
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index dbce5cd06..bb15b7f01 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -298,6 +298,12 @@ static inline size_t PA_ALIGN(size_t l) {
? (-1 - PA_INT_TYPE_MAX(type)) \
: (type) 0))
+/* The '#' preprocessor operator doesn't expand any macros that are in the
+ * parameter, which is why we need a separate macro for those cases where the
+ * parameter contains a macro that needs expanding. */
+#define PA_STRINGIZE(x) #x
+#define PA_EXPAND_AND_STRINGIZE(x) PA_STRINGIZE(x)
+
/* We include this at the very last place */
#include <pulsecore/log.h>

View File

@ -39,7 +39,7 @@
Name: pulseaudio
Summary: Improved Linux Sound Server
Version: %{pa_major}%{?pa_minor:.%{pa_minor}}
Release: 2%{?snap:.%{snap}git%{shortcommit}}%{?dist}
Release: 3%{?snap:.%{snap}git%{shortcommit}}%{?dist}
License: LGPLv2+
URL: http://www.freedesktop.org/wiki/Software/PulseAudio
%if 0%{?gitrel}
@ -75,6 +75,10 @@ Patch8: 0008-set-exit_idle_time-to-0-when-we-detect-a-session.patch
#https://bugzilla.redhat.com/show_bug.cgi?id=1594596
#https://bugs.freedesktop.org/show_bug.cgi?id=107044
Patch100: switch-on-port-available-ignore-bluetooth-cards.patch
# candidate fix for
#https://bugzilla.redhat.com/show_bug.cgi?id=1594568
#https://bugs.freedesktop.org/show_bug.cgi?id=107078
Patch101: ladspa-sink-fix-search-path.patch
BuildRequires: automake libtool
BuildRequires: gcc-c++
@ -278,6 +282,7 @@ This package contains GDM integration hooks for the PulseAudio sound server.
## upstreamable patches
%patch100 -p1 -b .switch-on-port-available-ignore-bluetooth-cards
%patch101 -p1 -b .ladspa-sink-fix-search-path
%patch201 -p1 -b .autostart
%patch202 -p1 -b .disable_flat_volumes
@ -675,6 +680,9 @@ exit 0
%changelog
* Thu Jul 05 2018 Rex Dieter <rdieter@fedoraproject.org> - 12.0-3
- ladspa-sink-fix-search-path.patch (#1594568, fdo#107078)
* Sun Jul 01 2018 Rex Dieter <rdieter@fedoraproject.org> - 12.0-2
- switch-on-port-available-ignore-bluetooth-cards.patch (#1594596, fdo#107044)
- use upstreamed exit-idle-time.patch