Hello community, here is the log from the commit of package alsa-plugins for openSUSE:Factory checked in at 2014-03-16 08:05:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alsa-plugins (Old) and /work/SRC/openSUSE:Factory/.alsa-plugins.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alsa-plugins" Changes: -------- --- /work/SRC/openSUSE:Factory/alsa-plugins/alsa-plugins.changes 2013-05-28 07:24:20.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.alsa-plugins.new/alsa-plugins.changes 2014-03-16 08:05:05.000000000 +0100 @@ -1,0 +2,14 @@ +Tue Mar 11 11:13:34 CET 2014 - [email protected] + +- Backport upstream fixes: add chmap support to plugins, fix a52 + builds, add a new option to jack plugin: + 0003-vdownmix-Add-chmap-support.patch + 0004-upmix-Add-chmap-support.patch + 0005-a52-Fix-build-error-with-the-recent-version.patch + 0006-a52-Add-chmap-support.patch + 0007-a52-Propagate-errors-from-hw.patch + 0008-a52-switch-to-AV_CODEC_ID-identifiers.patch + 0009-jack-Allow-to-specify-a-client-name-as-parameters.patch +- Run spec-cleaner + +------------------------------------------------------------------- New: ---- 0003-vdownmix-Add-chmap-support.patch 0004-upmix-Add-chmap-support.patch 0005-a52-Fix-build-error-with-the-recent-version.patch 0006-a52-Add-chmap-support.patch 0007-a52-Propagate-errors-from-hw.patch 0008-a52-switch-to-AV_CODEC_ID-identifiers.patch 0009-jack-Allow-to-specify-a-client-name-as-parameters.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alsa-plugins.spec ++++++ --- /var/tmp/diff_new_pack.99mnTz/_old 2014-03-16 08:05:05.000000000 +0100 +++ /var/tmp/diff_new_pack.99mnTz/_new 2014-03-16 08:05:05.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package alsa-plugins # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,45 +16,51 @@ # -%if %suse_version > 1030 +%define package_version 1.0.27 +%if 0%{?suse_version} > 1030 %define build_pulse 1 %define build_speex 1 %else %define build_pulse 0 %define build_speex 0 %endif - Name: alsa-plugins +Version: 1.0.27 +Release: 0 +Summary: Extra Plug-Ins for the ALSA Library +License: LGPL-2.1+ +Group: System/Libraries +Url: http://www.alsa-project.org/ +Source: ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-%{package_version}.tar.bz2 +Source1: asound-pulse.conf +Source2: alsa-pulse.conf +Source3: baselibs.conf +# upstream fixes +Patch1: 0001-Check-for-and-include-libavutil.h-to-avoid-unresolve.patch +Patch2: 0002-Add-AM_MAINTAINER_MODE-enable-to-configure.in.patch +Patch3: 0003-vdownmix-Add-chmap-support.patch +Patch4: 0004-upmix-Add-chmap-support.patch +Patch5: 0005-a52-Fix-build-error-with-the-recent-version.patch +Patch6: 0006-a52-Add-chmap-support.patch +Patch7: 0007-a52-Propagate-errors-from-hw.patch +Patch8: 0008-a52-switch-to-AV_CODEC_ID-identifiers.patch +Patch9: 0009-jack-Allow-to-specify-a-client-name-as-parameters.patch BuildRequires: alsa-devel BuildRequires: dbus-1-devel BuildRequires: libjack-devel BuildRequires: libjack0 BuildRequires: libsamplerate-devel BuildRequires: libtool -%if %build_pulse +BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if %{build_pulse} BuildRequires: libpulse-devel %endif -%if %build_speex +%if %{build_speex} BuildRequires: speex-devel %endif -%define package_version 1.0.27 -Url: http://www.alsa-project.org/ -Summary: Extra Plug-Ins for the ALSA Library -License: LGPL-2.1+ -Group: System/Libraries -Version: 1.0.27 -Release: 0 %ifarch s390x Recommends: %{name}-32bit = %{version} %endif -Source: ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-%{package_version}.tar.bz2 -Source1: asound-pulse.conf -Source2: alsa-pulse.conf -Source3: baselibs.conf -# upstream fixes -Patch1: 0001-Check-for-and-include-libavutil.h-to-avoid-unresolve.patch -Patch2: 0002-Add-AM_MAINTAINER_MODE-enable-to-configure.in.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description This package contains the extra plug-ins for the ALSA library. @@ -72,7 +78,7 @@ This package contains the JACK (Jack Audio Connection Kit) I/O plug-in for the ALSA library. -%if %build_pulse +%if %{build_pulse} %package pulse Summary: Pulseaudio Plug-In for the ALSA Library @@ -113,7 +119,7 @@ This package contains the sample rate converter plugin for the ALSA library using libsamplerate. -%if %build_speex +%if %{build_speex} %package speex Summary: Speex Prerocessor Plug-In for the ALSA Library @@ -133,6 +139,13 @@ %setup -q -n %{name}-%{package_version} %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build export AUTOMAKE_JOBS="%{?_smp_mflags}" @@ -142,14 +155,14 @@ make %{?_smp_mflags} %install -%makeinstall -mkdir -p %{buildroot}/etc/ -%if %build_pulse -%__install -m 0644 %_sourcedir/asound-pulse.conf %{buildroot}/etc/ -%__install -m 0644 %_sourcedir/alsa-pulse.conf %{buildroot}/etc/ +make DESTDIR=%{buildroot} install %{?_smp_mflags} +mkdir -p %{buildroot}%{_sysconfdir}/ +%if %{build_pulse} +install -m 0644 %{_sourcedir}/asound-pulse.conf %{buildroot}%{_sysconfdir}/ +install -m 0644 %{_sourcedir}/alsa-pulse.conf %{buildroot}%{_sysconfdir}/ %endif # modules don't need *.la files -rm -f $RPM_BUILD_ROOT%{_libdir}/alsa-lib/*.la +find %{buildroot} -type f -name "*.la" -delete -print %post pulse if type -p setup-pulseaudio > /dev/null; then @@ -184,7 +197,7 @@ %doc COPYING %doc doc/README-jack %{_libdir}/alsa-lib/libasound_module_pcm_jack.so -%if %build_pulse +%if %{build_pulse} %files pulse %defattr(-, root, root) @@ -193,8 +206,8 @@ %{_libdir}/alsa-lib/libasound_module_ctl_pulse.so %{_libdir}/alsa-lib/libasound_module_pcm_pulse.so %{_libdir}/alsa-lib/libasound_module_conf_pulse.so -%config /etc/asound-pulse.conf -%config /etc/alsa-pulse.conf +%config %{_sysconfdir}/asound-pulse.conf +%config %{_sysconfdir}/alsa-pulse.conf %{_datadir}/alsa/alsa.conf.d %endif @@ -210,7 +223,7 @@ %doc COPYING.GPL %doc doc/samplerate.txt %{_libdir}/alsa-lib/libasound_module_rate_samplerate*.so -%if %build_speex +%if %{build_speex} %files speex %defattr(-, root, root) ++++++ 0003-vdownmix-Add-chmap-support.patch ++++++ >From 73d7330b2798b8c005f990688d1ef365c30f4897 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <[email protected]> Date: Wed, 9 Oct 2013 16:28:47 +0200 Subject: [PATCH] vdownmix: Add chmap support Signed-off-by: Takashi Iwai <[email protected]> --- mix/pcm_vdownmix.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/mix/pcm_vdownmix.c b/mix/pcm_vdownmix.c index 85eafad11cc8..03e5adba9ddc 100644 --- a/mix/pcm_vdownmix.c +++ b/mix/pcm_vdownmix.c @@ -277,10 +277,58 @@ static int vdownmix_init(snd_pcm_extplug_t *ext) return 0; } +#if SND_PCM_EXTPLUG_VERSION >= 0x102 +static unsigned int chmap[6] = { + SND_CHMAP_FL, SND_CHMAP_FR, + SND_CHMAP_RL, SND_CHMAP_RR, + SND_CHMAP_FC, SND_CHMAP_LFE, +}; + +static snd_pcm_chmap_query_t **vdownmix_query_chmaps(snd_pcm_extplug_t *ext ATTRIBUTE_UNUSED) +{ + snd_pcm_chmap_query_t **maps; + int i; + + maps = calloc(4, sizeof(void *)); + if (!maps) + return NULL; + for (i = 0; i < 3; i++) { + snd_pcm_chmap_query_t *p; + p = maps[i] = calloc(i + 4 + 2, sizeof(int)); + if (!p) { + snd_pcm_free_chmaps(maps); + return NULL; + } + p->type = SND_CHMAP_TYPE_FIXED; + p->map.channels = i + 4; + memcpy(p->map.pos, chmap, (i + 4) * sizeof(int)); + } + return maps; +} + +static snd_pcm_chmap_t *vdownmix_get_chmap(snd_pcm_extplug_t *ext) +{ + snd_pcm_chmap_t *map; + + if (ext->channels < 4 || ext->channels > 6) + return NULL; + map = malloc((ext->channels + 1) * sizeof(int)); + if (!map) + return NULL; + map->channels = ext->channels; + memcpy(map->pos, chmap, ext->channels * sizeof(int)); + return map; +} +#endif /* SND_PCM_EXTPLUG_VERSION >= 0x102 */ + static const snd_pcm_extplug_callback_t vdownmix_callback = { .transfer = vdownmix_transfer, .init = vdownmix_init, /* .dump = filr_dump, */ +#if SND_PCM_EXTPLUG_VERSION >= 0x102 + .query_chmaps = vdownmix_query_chmaps, + .get_chmap = vdownmix_get_chmap, +#endif }; SND_PCM_PLUGIN_DEFINE_FUNC(vdownmix) -- 1.9.0 ++++++ 0004-upmix-Add-chmap-support.patch ++++++ >From 2d20afb50a8ec3302346bb85770a7a6a4f7daadc Mon Sep 17 00:00:00 2001 From: Takashi Iwai <[email protected]> Date: Wed, 9 Oct 2013 16:59:20 +0200 Subject: [PATCH] upmix: Add chmap support Signed-off-by: Takashi Iwai <[email protected]> --- mix/pcm_upmix.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/mix/pcm_upmix.c b/mix/pcm_upmix.c index e5148e0a1aa4..de5be41f717c 100644 --- a/mix/pcm_upmix.c +++ b/mix/pcm_upmix.c @@ -371,10 +371,63 @@ static int upmix_close(snd_pcm_extplug_t *ext) return 0; } +#if SND_PCM_EXTPLUG_VERSION >= 0x102 +static unsigned int chmap[8][8] = { + { SND_CHMAP_MONO }, + { SND_CHMAP_FL, SND_CHMAP_FR }, + { SND_CHMAP_FL, SND_CHMAP_FR, SND_CHMAP_FC }, + { SND_CHMAP_FL, SND_CHMAP_FR, SND_CHMAP_RL, SND_CHMAP_RR }, + { SND_CHMAP_FL, SND_CHMAP_FR, SND_CHMAP_RL, SND_CHMAP_RR, SND_CHMAP_FC }, + { SND_CHMAP_FL, SND_CHMAP_FR, SND_CHMAP_RL, SND_CHMAP_RR, SND_CHMAP_FC, SND_CHMAP_LFE }, + { SND_CHMAP_FL, SND_CHMAP_FR, SND_CHMAP_RL, SND_CHMAP_RR, SND_CHMAP_FC, SND_CHMAP_LFE, SND_CHMAP_UNKNOWN }, + { SND_CHMAP_FL, SND_CHMAP_FR, SND_CHMAP_RL, SND_CHMAP_RR, SND_CHMAP_FC, SND_CHMAP_LFE, SND_CHMAP_SL, SND_CHMAP_SR }, +}; + +static snd_pcm_chmap_query_t **upmix_query_chmaps(snd_pcm_extplug_t *ext ATTRIBUTE_UNUSED) +{ + snd_pcm_chmap_query_t **maps; + int i; + + maps = calloc(9, sizeof(void *)); + if (!maps) + return NULL; + for (i = 0; i < 8; i++) { + snd_pcm_chmap_query_t *p; + p = maps[i] = calloc(i + 1 + 2, sizeof(int)); + if (!p) { + snd_pcm_free_chmaps(maps); + return NULL; + } + p->type = SND_CHMAP_TYPE_FIXED; + p->map.channels = i + 1; + memcpy(p->map.pos, &chmap[i][0], (i + 1) * sizeof(int)); + } + return maps; +} + +static snd_pcm_chmap_t *upmix_get_chmap(snd_pcm_extplug_t *ext) +{ + snd_pcm_chmap_t *map; + + if (ext->channels < 1 || ext->channels > 8) + return NULL; + map = malloc((ext->channels + 1) * sizeof(int)); + if (!map) + return NULL; + map->channels = ext->channels; + memcpy(map->pos, &chmap[ext->channels - 1][0], ext->channels * sizeof(int)); + return map; +} +#endif /* SND_PCM_EXTPLUG_VERSION >= 0x102 */ + static const snd_pcm_extplug_callback_t upmix_callback = { .transfer = upmix_transfer, .init = upmix_init, .close = upmix_close, +#if SND_PCM_EXTPLUG_VERSION >= 0x102 + .query_chmaps = upmix_query_chmaps, + .get_chmap = upmix_get_chmap, +#endif }; SND_PCM_PLUGIN_DEFINE_FUNC(upmix) -- 1.9.0 ++++++ 0005-a52-Fix-build-error-with-the-recent-version.patch ++++++ >From 1651e6f890a4ac18397dbb862402cecf522dfe0a Mon Sep 17 00:00:00 2001 From: Takashi Iwai <[email protected]> Date: Wed, 9 Oct 2013 17:24:35 +0200 Subject: [PATCH] a52: Fix build error with the recent version The version check for USE_AVCODEC_FRAME wasn't done correctly, and it failed to build with version 54.x or later. Signed-off-by: Takashi Iwai <[email protected]> --- a52/pcm_a52.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 75c68bd5de6e..8fd52c2ee74f 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -28,12 +28,6 @@ #include AVCODEC_HEADER #include <libavutil/avutil.h> -#if LIBAVCODEC_VERSION_MAJOR >= 53 && LIBAVCODEC_VERSION_MINOR >= 34 -#include <libavutil/audioconvert.h> -#include <libavutil/mem.h> -#define USE_AVCODEC_FRAME -#endif - /* some compatibility wrappers */ #ifndef AV_VERSION_INT #define AV_VERSION_INT(a, b, c) (((a) << 16) | ((b) << 8) | (c)) @@ -44,6 +38,12 @@ LIBAVCODEC_VERSION_MICRO) #endif +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 34, 0) +#include <libavutil/audioconvert.h> +#include <libavutil/mem.h> +#define USE_AVCODEC_FRAME +#endif + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 0, 0) #ifndef AV_CH_LAYOUT_STEREO #define AV_CH_LAYOUT_STEREO CH_LAYOUT_STEREO -- 1.9.0 ++++++ 0006-a52-Add-chmap-support.patch ++++++ >From 59ab64ad836446b7c06340e6935bd1fc8ce5c3f6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <[email protected]> Date: Wed, 9 Oct 2013 17:25:50 +0200 Subject: [PATCH] a52: Add chmap support Signed-off-by: Takashi Iwai <[email protected]> --- a52/pcm_a52.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 8fd52c2ee74f..7188809bc7bf 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -649,6 +649,56 @@ static int a52_close(snd_pcm_ioplug_t *io) return 0; } +#if SND_PCM_IOPLUG_VERSION >= 0x102 +static unsigned int chmap4[4] = { + SND_CHMAP_FL, SND_CHMAP_FR, + SND_CHMAP_RL, SND_CHMAP_RR, +}; +static unsigned int chmap6[6] = { + SND_CHMAP_FL, SND_CHMAP_FR, + SND_CHMAP_FC, SND_CHMAP_LFE, + SND_CHMAP_RL, SND_CHMAP_RR, +}; + +static snd_pcm_chmap_query_t **a52_query_chmaps(snd_pcm_ioplug_t *io ATTRIBUTE_UNUSED) +{ + snd_pcm_chmap_query_t **maps; + int i; + + maps = calloc(4, sizeof(void *)); + if (!maps) + return NULL; + for (i = 0; i < 3; i++) { + snd_pcm_chmap_query_t *p; + p = maps[i] = calloc((i + 1) * 2 + 2, sizeof(int)); + if (!p) { + snd_pcm_free_chmaps(maps); + return NULL; + } + p->type = SND_CHMAP_TYPE_FIXED; + p->map.channels = (i + 1) * 2; + memcpy(p->map.pos, i < 2 ? chmap4 : chmap6, + (i + 1) * 2 * sizeof(int)); + } + return maps; +} + +static snd_pcm_chmap_t *a52_get_chmap(snd_pcm_ioplug_t *io) +{ + snd_pcm_chmap_t *map; + + if ((io->channels % 2) || io->channels < 2 || io->channels > 6) + return NULL; + map = malloc((io->channels + 1) * sizeof(int)); + if (!map) + return NULL; + map->channels = io->channels; + memcpy(map->pos, io->channels < 6 ? chmap4 : chmap6, + io->channels * sizeof(int)); + return map; +} +#endif /* SND_PCM_IOPLUG_VERSION >= 0x102 */ + /* * callback table */ @@ -666,6 +716,10 @@ static snd_pcm_ioplug_callback_t a52_ops = { .poll_descriptors_count = a52_poll_descriptors_count, .poll_descriptors = a52_poll_descriptors, .poll_revents = a52_poll_revents, +#if SND_PCM_IOPLUG_VERSION >= 0x102 + .query_chmaps = a52_query_chmaps, + .get_chmap = a52_get_chmap, +#endif /* SND_PCM_IOPLUG_VERSION >= 0x102 */ }; /* -- 1.9.0 ++++++ 0007-a52-Propagate-errors-from-hw.patch ++++++ >From 9123179acde7f475c1ed1297aac727230e9d5bf5 Mon Sep 17 00:00:00 2001 From: David Henningsson <[email protected]> Date: Wed, 1 Jan 2014 13:17:38 +0100 Subject: [PATCH] a52: Propagate errors from hw Several callbacks returned 0 even though the hw was failing, leading applications to believe everything was fine when it wasn't. Signed-off-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> --- a52/pcm_a52.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 7188809bc7bf..359608fbafe3 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -195,8 +195,8 @@ static int a52_drain(snd_pcm_ioplug_t *io) err = write_out_pending(io, rec); if (err < 0) return err; - snd_pcm_drain(rec->slave); - return 0; + + return snd_pcm_drain(rec->slave); } /* check whether the areas consist of a continuous interleaved stream */ @@ -479,16 +479,14 @@ static int a52_start(snd_pcm_ioplug_t *io) { struct a52_ctx *rec = io->private_data; - snd_pcm_start(rec->slave); - return 0; + return snd_pcm_start(rec->slave); } static int a52_stop(snd_pcm_ioplug_t *io) { struct a52_ctx *rec = io->private_data; - snd_pcm_drop(rec->slave); - return 0; + return snd_pcm_drop(rec->slave); } /* release resources */ @@ -645,7 +643,7 @@ static int a52_close(snd_pcm_ioplug_t *io) a52_free(rec); if (rec->slave) - snd_pcm_close(rec->slave); + return snd_pcm_close(rec->slave); return 0; } -- 1.9.0 ++++++ 0008-a52-switch-to-AV_CODEC_ID-identifiers.patch ++++++ >From 367e208954711fabe159070d242927246ed821cd Mon Sep 17 00:00:00 2001 From: Anton Khirnov <[email protected]> Date: Thu, 9 Jan 2014 21:14:17 +0100 Subject: [PATCH] a52: switch to AV_CODEC_ID identifiers Fixes build with latest libavcodec versions. Signed-off-by: Takashi Iwai <[email protected]> --- a52/pcm_a52.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 359608fbafe3..b467ec8e5abb 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -58,6 +58,9 @@ #endif #endif +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 25, 0) +#define AV_CODEC_ID_AC3 CODEC_ID_AC3 +#endif struct a52_ctx { snd_pcm_ioplug_t io; @@ -916,7 +919,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52) if (rec->codec == NULL) rec->codec = avcodec_find_encoder_by_name("ac3"); if (rec->codec == NULL) - rec->codec = avcodec_find_encoder(CODEC_ID_AC3); + rec->codec = avcodec_find_encoder(AV_CODEC_ID_AC3); if (rec->codec == NULL) { SNDERR("Cannot find codec engine"); err = -EINVAL; -- 1.9.0 ++++++ 0009-jack-Allow-to-specify-a-client-name-as-parameters.patch ++++++ >From 14190cd8a1f0df42f2b9a33a16789c85b69356a3 Mon Sep 17 00:00:00 2001 From: Valentin Corfu <[email protected]> Date: Tue, 11 Feb 2014 04:06:36 -0500 Subject: [PATCH] jack: Allow to specify a client name as parameters The current jack client name contains the process id of the application providing the audio samples. This leads to unpredictable jack client names which makes handling of the connections by a controlling application very hard. This modification now, allows to specify a client name as parameters in the configuration file. The implementation is backward compatible and simply adds a new configuration option to the plugin. [reformatted and small refactoring by tiwai] Signed-off-by: Valentin Corfu <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> --- jack/pcm_jack.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c index c51fe84242e3..42137085e22c 100644 --- a/jack/pcm_jack.c +++ b/jack/pcm_jack.c @@ -356,9 +356,16 @@ static int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, return -EINVAL; } - if (snprintf(jack_client_name, sizeof(jack_client_name), "alsa-jack.%s%s.%d.%d", name, - stream == SND_PCM_STREAM_PLAYBACK ? "P" : "C", getpid(), num++) - >= (int)sizeof(jack_client_name)) { + if (name == NULL) + err = snprintf(jack_client_name, sizeof(jack_client_name), + "alsa-jack.%s%s.%d.%d", name, + stream == SND_PCM_STREAM_PLAYBACK ? "P" : "C", + getpid(), num++); + else + err = snprintf(jack_client_name, sizeof(jack_client_name), + "%s", name); + + if (err >= (int)sizeof(jack_client_name)) { fprintf(stderr, "%s: WARNING: JACK client name '%s' truncated to %d characters, might not be unique\n", __func__, jack_client_name, (int)strlen(jack_client_name)); } @@ -369,7 +376,7 @@ static int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, snd_pcm_jack_free(jack); return -ENOENT; } - + jack->areas = calloc(jack->channels, sizeof(snd_pcm_channel_area_t)); if (! jack->areas) { snd_pcm_jack_free(jack); @@ -423,6 +430,10 @@ SND_PCM_PLUGIN_DEFINE_FUNC(jack) continue; if (strcmp(id, "comment") == 0 || strcmp(id, "type") == 0 || strcmp(id, "hint") == 0) continue; + if (strcmp(id, "name") == 0) { + snd_config_get_string(n, &name); + continue; + } if (strcmp(id, "playback_ports") == 0) { if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) { SNDERR("Invalid type for %s", id); -- 1.9.0 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
