Hello community, here is the log from the commit of package alsa for openSUSE:Factory checked in at 2020-06-27 23:20:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alsa (Old) and /work/SRC/openSUSE:Factory/.alsa.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alsa" Sat Jun 27 23:20:22 2020 rev:202 rq:816057 version:1.2.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/alsa/alsa.changes 2020-06-11 14:46:19.181665260 +0200 +++ /work/SRC/openSUSE:Factory/.alsa.new.3060/alsa.changes 2020-06-27 23:20:24.085392471 +0200 @@ -1,0 +2,7 @@ +Fri Jun 19 16:06:40 CEST 2020 - [email protected] + +- Update to alsa-lib 1.2.3.1: + a bug fix release, see the detailed changes at: + https://www.alsa-project.org/wiki/Changes_v1.2.3_v1.2.3.1 + +------------------------------------------------------------------- Old: ---- alsa-lib-1.2.3.tar.bz2 New: ---- alsa-lib-1.2.3.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alsa.spec ++++++ --- /var/tmp/diff_new_pack.19Agy8/_old 2020-06-27 23:20:26.677400993 +0200 +++ /var/tmp/diff_new_pack.19Agy8/_new 2020-06-27 23:20:26.677400993 +0200 @@ -26,7 +26,7 @@ %endif Name: alsa -Version: 1.2.3 +Version: 1.2.3.1 Release: 0 Summary: Advanced Linux Sound Architecture License: LGPL-2.1-or-later ++++++ alsa-lib-1.2.3.tar.bz2 -> alsa-lib-1.2.3.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/configure new/alsa-lib-1.2.3.1/configure --- old/alsa-lib-1.2.3/configure 2020-06-08 15:07:13.000000000 +0200 +++ new/alsa-lib-1.2.3.1/configure 2020-06-18 19:25:45.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for alsa-lib 1.2.3. +# Generated by GNU Autoconf 2.69 for alsa-lib 1.2.3.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='alsa-lib' PACKAGE_TARNAME='alsa-lib' -PACKAGE_VERSION='1.2.3' -PACKAGE_STRING='alsa-lib 1.2.3' +PACKAGE_VERSION='1.2.3.1' +PACKAGE_STRING='alsa-lib 1.2.3.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1457,7 +1457,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures alsa-lib 1.2.3 to adapt to many kinds of systems. +\`configure' configures alsa-lib 1.2.3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1527,7 +1527,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of alsa-lib 1.2.3:";; + short | recursive ) echo "Configuration of alsa-lib 1.2.3.1:";; esac cat <<\_ACEOF @@ -1688,7 +1688,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -alsa-lib configure 1.2.3 +alsa-lib configure 1.2.3.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2099,7 +2099,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by alsa-lib $as_me 1.2.3, which was +It was created by alsa-lib $as_me 1.2.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3037,7 +3037,7 @@ # Define the identity of the package. PACKAGE='alsa-lib' - VERSION='1.2.3' + VERSION='1.2.3.1' cat >>confdefs.h <<_ACEOF @@ -14887,7 +14887,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by alsa-lib $as_me 1.2.3, which was +This file was extended by alsa-lib $as_me 1.2.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14953,7 +14953,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -alsa-lib config.status 1.2.3 +alsa-lib config.status 1.2.3.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/configure.ac new/alsa-lib-1.2.3.1/configure.ac --- old/alsa-lib-1.2.3/configure.ac 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/configure.ac 2020-06-18 19:24:32.000000000 +0200 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(alsa-lib, 1.2.3) +AC_INIT(alsa-lib, 1.2.3.1) AC_CONFIG_SRCDIR([src/control/control.c]) AC_CONFIG_MACRO_DIR([m4]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/include/version.h new/alsa-lib-1.2.3.1/include/version.h --- old/alsa-lib-1.2.3/include/version.h 2020-06-08 15:07:27.000000000 +0200 +++ new/alsa-lib-1.2.3.1/include/version.h 2020-06-18 19:26:02.000000000 +0200 @@ -11,5 +11,5 @@ (SND_LIB_MINOR<<8)|\ SND_LIB_SUBMINOR) /** library version (string) */ -#define SND_LIB_VERSION_STR "1.2.3" +#define SND_LIB_VERSION_STR "1.2.3.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/libtool new/alsa-lib-1.2.3.1/libtool --- old/alsa-lib-1.2.3/libtool 2020-06-08 15:07:26.000000000 +0200 +++ new/alsa-lib-1.2.3.1/libtool 2020-06-18 19:25:59.000000000 +0200 @@ -1,5 +1,5 @@ #! /bin/sh -# Generated automatically by config.status (alsa-lib) 1.2.3 +# Generated automatically by config.status (alsa-lib) 1.2.3.1 # Libtool was configured on host e010f88cea4a: # NOTE: Changes made to this file will be lost: look at ltmain.sh. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/conf/alsa.conf new/alsa-lib-1.2.3.1/src/conf/alsa.conf --- old/alsa-lib-1.2.3/src/conf/alsa.conf 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/conf/alsa.conf 2020-06-18 19:24:32.000000000 +0200 @@ -82,11 +82,11 @@ defaults.pcm.ipc_key 5678293 defaults.pcm.ipc_gid audio defaults.pcm.ipc_perm 0660 -defaults.pcm.tstamp_type "default" +defaults.pcm.tstamp_type default defaults.pcm.dmix.max_periods 0 defaults.pcm.dmix.channels 2 defaults.pcm.dmix.rate 48000 -defaults.pcm.dmix.format "unchanged" +defaults.pcm.dmix.format unchanged defaults.pcm.dmix.card defaults.pcm.card defaults.pcm.dmix.device defaults.pcm.device defaults.pcm.dsnoop.card defaults.pcm.card @@ -115,9 +115,8 @@ defaults.pcm.iec958.device defaults.pcm.device defaults.pcm.modem.card defaults.pcm.card defaults.pcm.modem.device defaults.pcm.device -# truncate files via file or tee PCM -defaults.pcm.file_format "raw" -defaults.pcm.file_truncate true +defaults.pcm.file_format raw +defaults.pcm.file_truncate true # truncate files via file or tee PCM defaults.rawmidi.card 0 defaults.rawmidi.device 0 defaults.rawmidi.subdevice -1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/control/ctlparse.c new/alsa-lib-1.2.3.1/src/control/ctlparse.c --- old/alsa-lib-1.2.3/src/control/ctlparse.c 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/control/ctlparse.c 2020-06-18 19:24:32.000000000 +0200 @@ -304,6 +304,25 @@ return -1; } +static unsigned int get_ctl_type_max_elements(snd_ctl_elem_type_t type) +{ + struct snd_ctl_elem_value value; + + switch (type) { + case SND_CTL_ELEM_TYPE_BOOLEAN: + case SND_CTL_ELEM_TYPE_INTEGER: + return ARRAY_SIZE(value.value.integer.value); + case SND_CTL_ELEM_TYPE_INTEGER64: + return ARRAY_SIZE(value.value.integer64.value); + case SND_CTL_ELEM_TYPE_ENUMERATED: + return ARRAY_SIZE(value.value.enumerated.item); + case SND_CTL_ELEM_TYPE_BYTES: + return ARRAY_SIZE(value.value.bytes.data); + default: + return 0; + } +} + /** * \brief parse ASCII string as CTL element value * \param handle CTL handle @@ -331,8 +350,11 @@ type = snd_ctl_elem_info_get_type(info); count = snd_ctl_elem_info_get_count(info); snd_ctl_elem_value_set_id(dst, &myid); + + if (count > get_ctl_type_max_elements(type)) + count = get_ctl_type_max_elements(type); - for (idx = 0; idx < count && idx < 128 && ptr && *ptr; idx++) { + for (idx = 0; idx < count && ptr && *ptr; idx++) { if (*ptr == ',') goto skip; switch (type) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/dlmisc.c new/alsa-lib-1.2.3.1/src/dlmisc.c --- old/alsa-lib-1.2.3/src/dlmisc.c 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/dlmisc.c 2020-06-18 19:24:32.000000000 +0200 @@ -34,14 +34,21 @@ #endif #include <limits.h> +#if defined(HAVE_LIBDL) && defined(__GLIBC__) && !defined(__UCLIBC__) +#define DL_ORIGIN_AVAILABLE 1 +#endif + #ifndef DOC_HIDDEN #ifndef PIC struct snd_dlsym_link *snd_dlsym_start = NULL; #endif +#ifdef DL_ORIGIN_AVAILABLE +static int snd_libdir_plugin_dir_set = 0; static char *snd_libdir_origin = NULL; #endif +#endif -#ifdef HAVE_LIBPTHREAD +#if defined(DL_ORIGIN_AVAILABLE) && defined(HAVE_LIBPTHREAD) static pthread_mutex_t snd_dlpath_mutex = PTHREAD_MUTEX_INITIALIZER; static inline void snd_dlpath_lock(void) @@ -68,11 +75,9 @@ */ int snd_dlpath(char *path, size_t path_len, const char *name) { -#ifdef HAVE_LIBDL -#ifdef __GLIBC__ - static int plugin_dir_set = 0; +#ifdef DL_ORIGIN_AVAILABLE snd_dlpath_lock(); - if (!plugin_dir_set) { + if (!snd_libdir_plugin_dir_set) { struct link_map *links; Dl_info info; char origin[PATH_MAX]; @@ -83,15 +88,17 @@ if (access(path, X_OK) == 0) snd_libdir_origin = strdup(origin); } - plugin_dir_set = 1; + snd_libdir_plugin_dir_set = 1; } - snd_dlpath_unlock(); -#endif -#endif - if (snd_libdir_origin) + if (snd_libdir_origin) { snprintf(path, path_len, "%s/alsa-lib/%s", snd_libdir_origin, name); - else + } else { snprintf(path, path_len, "%s/%s", ALSA_PLUGIN_DIR, name); + } + snd_dlpath_unlock(); +#else + snprintf(path, path_len, "%s/%s", ALSA_PLUGIN_DIR, name); +#endif return 0; } @@ -440,7 +447,13 @@ free((void *)c->lib); /* shut up gcc warning */ free(c); } - free(snd_libdir_origin); snd_dlobj_unlock(); +#ifdef DL_ORIGIN_AVAILABLE + snd_dlpath_lock(); + snd_libdir_plugin_dir_set = 0; + free(snd_libdir_origin); + snd_libdir_origin = NULL; + snd_dlpath_unlock(); +#endif } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/pcm/pcm_direct.c new/alsa-lib-1.2.3.1/src/pcm/pcm_direct.c --- old/alsa-lib-1.2.3/src/pcm/pcm_direct.c 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/pcm/pcm_direct.c 2020-06-18 19:24:32.000000000 +0200 @@ -929,10 +929,14 @@ return err; if (dshare->var_periodsize) { /* more tolerant settings... */ - if (dshare->shmptr->hw.buffer_size.max / 2 > period_size.max) + if (dshare->shmptr->hw.buffer_size.max / 2 > period_size.max) { period_size.max = dshare->shmptr->hw.buffer_size.max / 2; - if (dshare->shmptr->hw.buffer_time.max / 2 > period_time.max) + period_size.openmax = dshare->shmptr->hw.buffer_size.openmax; + } + if (dshare->shmptr->hw.buffer_time.max / 2 > period_time.max) { period_time.max = dshare->shmptr->hw.buffer_time.max / 2; + period_time.openmax = dshare->shmptr->hw.buffer_time.openmax; + } } err = hw_param_interval_refine_one(params, SND_PCM_HW_PARAM_PERIOD_SIZE, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/pcm/pcm_dmix_x86_64.h new/alsa-lib-1.2.3.1/src/pcm/pcm_dmix_x86_64.h --- old/alsa-lib-1.2.3/src/pcm/pcm_dmix_x86_64.h 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/pcm/pcm_dmix_x86_64.h 2020-06-18 19:24:32.000000000 +0200 @@ -58,9 +58,15 @@ /* * initialization, load RSI, RDI, RBX registers */ +#ifndef _ILP32 "\tmovq %[dst], %%rdi\n" "\tmovq %[src], %%rsi\n" "\tmovq %[sum], %%rbx\n" +#else + "\tmovl %[dst], %%edi\n" + "\tmovl %[src], %%esi\n" + "\tmovl %[sum], %%ebx\n" +#endif /* * while (size-- > 0) { @@ -109,9 +115,15 @@ /* * while (size-- > 0) */ - "\tadd %[dst_step], %%rdi\n" - "\tadd %[src_step], %%rsi\n" - "\tadd %[sum_step], %%rbx\n" +#ifndef _ILP32 + "\taddq %[dst_step], %%rdi\n" + "\taddq %[src_step], %%rsi\n" + "\taddq %[sum_step], %%rbx\n" +#else + "\taddl %[dst_step], %%edi\n" + "\taddl %[src_step], %%esi\n" + "\taddl %[sum_step], %%ebx\n" +#endif "\tdecl %[size]\n" "\tjnz 1b\n" @@ -168,9 +180,15 @@ /* * initialization, load RSI, RDI, RBX registers */ +#ifndef _ILP32 "\tmovq %[dst], %%rdi\n" "\tmovq %[src], %%rsi\n" "\tmovq %[sum], %%rbx\n" +#else + "\tmovl %[dst], %%edi\n" + "\tmovl %[src], %%esi\n" + "\tmovl %[sum], %%ebx\n" +#endif /* * while (size-- > 0) { @@ -241,9 +259,15 @@ /* * while (size-- > 0) */ - "\tadd %[dst_step], %%rdi\n" - "\tadd %[src_step], %%rsi\n" - "\tadd %[sum_step], %%rbx\n" +#ifndef _ILP32 + "\taddq %[dst_step], %%rdi\n" + "\taddq %[src_step], %%rsi\n" + "\taddq %[sum_step], %%rbx\n" +#else + "\taddl %[dst_step], %%edi\n" + "\taddl %[src_step], %%esi\n" + "\taddl %[sum_step], %%ebx\n" +#endif "\tdecl %[size]\n" "\tjnz 1b\n" @@ -292,9 +316,15 @@ /* * initialization, load RSI, RDI, RBX registers */ +#ifndef _ILP32 "\tmovq %[dst], %%rdi\n" "\tmovq %[src], %%rsi\n" "\tmovq %[sum], %%rbx\n" +#else + "\tmovl %[dst], %%edi\n" + "\tmovl %[src], %%esi\n" + "\tmovl %[sum], %%ebx\n" +#endif /* * while (size-- > 0) { @@ -353,9 +383,15 @@ /* * while (size-- > 0) */ - "\tadd %[dst_step], %%rdi\n" - "\tadd %[src_step], %%rsi\n" - "\tadd %[sum_step], %%rbx\n" +#ifndef _ILP32 + "\taddq %[dst_step], %%rdi\n" + "\taddq %[src_step], %%rsi\n" + "\taddq %[sum_step], %%rbx\n" +#else + "\taddl %[dst_step], %%edi\n" + "\taddl %[src_step], %%esi\n" + "\taddl %[sum_step], %%ebx\n" +#endif "\tdecl %[size]\n" "\tjnz 1b\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/pcm/pcm_extplug.c new/alsa-lib-1.2.3.1/src/pcm/pcm_extplug.c --- old/alsa-lib-1.2.3/src/pcm/pcm_extplug.c 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/pcm/pcm_extplug.c 2020-06-18 19:24:32.000000000 +0200 @@ -732,6 +732,7 @@ pcm->private_data = ext; pcm->poll_fd = spcm->poll_fd; pcm->poll_events = spcm->poll_events; + pcm->tstamp_type = spcm->tstamp_type; snd_pcm_set_hw_ptr(pcm, &ext->plug.hw_ptr, -1, 0); snd_pcm_set_appl_ptr(pcm, &ext->plug.appl_ptr, -1, 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/ucm/parser.c new/alsa-lib-1.2.3.1/src/ucm/parser.c --- old/alsa-lib-1.2.3/src/ucm/parser.c 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/ucm/parser.c 2020-06-18 19:24:32.000000000 +0200 @@ -617,11 +617,12 @@ return err; cmpt_seq->device = find_component_dev(uc_mgr, val); - free(val); if (!cmpt_seq->device) { uc_error("error: Cannot find component device %s", val); + free(val); return -EINVAL; } + free(val); /* Parent needs its enable or disable sequence */ cmpt_seq->enable = enable; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/ucm/ucm_include.c new/alsa-lib-1.2.3.1/src/ucm/ucm_include.c --- old/alsa-lib-1.2.3/src/ucm/ucm_include.c 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/ucm/ucm_include.c 2020-06-18 19:24:32.000000000 +0200 @@ -149,6 +149,18 @@ } idx = 0; + + /* for array, use a temporary non-clashing identifier */ + if (array > 0) { + snd_config_for_each(i, next, dst) { + n = snd_config_iterator_entry(i); + snprintf(tmpid, sizeof(tmpid), "_tmp_%d", idx++); + err = snd_config_set_id(n, tmpid); + if (err < 0) + return err; + } + } + snd_config_for_each(i, next, src) { n = snd_config_iterator_entry(i); err = snd_config_remove(n); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/src/ucm/ucm_subs.c new/alsa-lib-1.2.3.1/src/ucm/ucm_subs.c --- old/alsa-lib-1.2.3/src/ucm/ucm_subs.c 2020-06-08 13:42:38.000000000 +0200 +++ new/alsa-lib-1.2.3.1/src/ucm/ucm_subs.c 2020-06-18 19:24:32.000000000 +0200 @@ -71,20 +71,23 @@ return NULL; } -static char *rval_card_number(snd_use_case_mgr_t *uc_mgr) +static char *get_card_number(struct ctl_list *ctl_list) { - struct ctl_list *ctl_list; char num[16]; - if (uc_mgr->conf_format < 3) - return NULL; - ctl_list = uc_mgr_get_master_ctl(uc_mgr); if (ctl_list == NULL) return strdup(""); snprintf(num, sizeof(num), "%i", snd_ctl_card_info_get_card(ctl_list->ctl_info)); return strdup(num); } +static char *rval_card_number(snd_use_case_mgr_t *uc_mgr) +{ + if (uc_mgr->conf_format < 3) + return NULL; + return get_card_number(uc_mgr_get_master_ctl(uc_mgr)); +} + static char *rval_card_id(snd_use_case_mgr_t *uc_mgr) { struct ctl_list *ctl_list; @@ -135,17 +138,11 @@ return strdup(snd_ctl_card_info_get_components(ctl_list->ctl_info)); } -static char *rval_card_id_by_name(snd_use_case_mgr_t *uc_mgr, const char *id) +static struct ctl_list *get_ctl_list_by_name(snd_use_case_mgr_t *uc_mgr, const char *id) { - struct ctl_list *ctl_list; char *name, *index; long idx = 0; - if (uc_mgr->conf_format < 3) { - uc_error("CardIdByName substitution is supported in v3+ syntax"); - return NULL; - } - name = alloca(strlen(id) + 1); strcpy(name, id); index = strchr(name, '#'); @@ -154,7 +151,29 @@ if (safe_strtol(index + 1, &idx)) return NULL; } - ctl_list = uc_mgr_get_ctl_by_name(uc_mgr, name, idx); + return uc_mgr_get_ctl_by_name(uc_mgr, name, idx); +} + +static char *rval_card_number_by_name(snd_use_case_mgr_t *uc_mgr, const char *id) +{ + if (uc_mgr->conf_format < 3) { + uc_error("CardNumberByName substitution is supported in v3+ syntax"); + return NULL; + } + + return get_card_number(get_ctl_list_by_name(uc_mgr, id)); +} + +static char *rval_card_id_by_name(snd_use_case_mgr_t *uc_mgr, const char *id) +{ + struct ctl_list *ctl_list; + + if (uc_mgr->conf_format < 3) { + uc_error("CardIdByName substitution is supported in v3+ syntax"); + return NULL; + } + + ctl_list = get_ctl_list_by_name(uc_mgr, id); if (ctl_list == NULL) return NULL; return strdup(snd_ctl_card_info_get_id(ctl_list->ctl_info)); @@ -246,19 +265,8 @@ #define MATCH_VARIABLE2(name, id, fcn) \ if (strncmp((name), (id), sizeof(id) - 1) == 0) { \ idsize = sizeof(id) - 1; \ - tmp = strchr(value + idsize, '}'); \ - if (tmp) { \ - rvalsize = tmp - (value + idsize); \ - if (rvalsize > sizeof(v2)) { \ - err = -ENOMEM; \ - goto __error; \ - } \ - strncpy(v2, value + idsize, rvalsize); \ - v2[rvalsize] = '\0'; \ - idsize += rvalsize + 1; \ - rval = fcn(uc_mgr, v2); \ - goto __rval; \ - } \ + fcn2 = (fcn); \ + goto __match2; \ } int uc_mgr_get_substituted_value(snd_use_case_mgr_t *uc_mgr, @@ -267,7 +275,9 @@ { size_t size, nsize, idsize, rvalsize, dpos = 0; const char *tmp; - char *r, *nr, *rval, v2[32]; + char *r, *nr, *rval, v2[48]; + bool ignore_error, allow_empty; + char *(*fcn2)(snd_use_case_mgr_t *, const char *id); int err; if (value == NULL) @@ -279,62 +289,101 @@ return -ENOMEM; while (*value) { - if (*value == '$' && *(value+1) == '{') { - bool allow_empty = false; - - MATCH_VARIABLE(value, "${OpenName}", rval_open_name, false); - MATCH_VARIABLE(value, "${ConfTopDir}", rval_conf_topdir, false); - MATCH_VARIABLE(value, "${ConfDir}", rval_conf_dir, false); - MATCH_VARIABLE(value, "${ConfName}", rval_conf_name, false); - MATCH_VARIABLE(value, "${CardNumber}", rval_card_number, true); - MATCH_VARIABLE(value, "${CardId}", rval_card_id, false); - MATCH_VARIABLE(value, "${CardDriver}", rval_card_driver, false); - MATCH_VARIABLE(value, "${CardName}", rval_card_name, false); - MATCH_VARIABLE(value, "${CardLongName}", rval_card_longname, false); - MATCH_VARIABLE(value, "${CardComponents}", rval_card_components, true); - MATCH_VARIABLE2(value, "${env:", rval_env); - MATCH_VARIABLE2(value, "${sys:", rval_sysfs); - MATCH_VARIABLE2(value, "${var:", rval_var); - MATCH_VARIABLE2(value, "${CardIdByName:", rval_card_id_by_name); - err = -EINVAL; - tmp = strchr(value, '}'); - if (tmp) { - strncpy(r, value, tmp + 1 - value); - r[tmp + 1 - value] = '\0'; - uc_error("variable '%s' is not known!", r); + if (*value != '$') { +__std: + r[dpos++] = *value; + value++; + continue; + } + ignore_error = false; + if (value[1] == '$' && value[2] == '{' && uc_mgr->conf_format >= 3) { + value++; + ignore_error = true; + } else if (value[1] != '{') { + goto __std; + } + allow_empty = false; + fcn2 = NULL; + MATCH_VARIABLE(value, "${OpenName}", rval_open_name, false); + MATCH_VARIABLE(value, "${ConfTopDir}", rval_conf_topdir, false); + MATCH_VARIABLE(value, "${ConfDir}", rval_conf_dir, false); + MATCH_VARIABLE(value, "${ConfName}", rval_conf_name, false); + MATCH_VARIABLE(value, "${CardNumber}", rval_card_number, true); + MATCH_VARIABLE(value, "${CardId}", rval_card_id, false); + MATCH_VARIABLE(value, "${CardDriver}", rval_card_driver, false); + MATCH_VARIABLE(value, "${CardName}", rval_card_name, false); + MATCH_VARIABLE(value, "${CardLongName}", rval_card_longname, false); + MATCH_VARIABLE(value, "${CardComponents}", rval_card_components, true); + MATCH_VARIABLE2(value, "${env:", rval_env); + MATCH_VARIABLE2(value, "${sys:", rval_sysfs); + MATCH_VARIABLE2(value, "${var:", rval_var); + MATCH_VARIABLE2(value, "${CardNumberByName:", rval_card_number_by_name); + MATCH_VARIABLE2(value, "${CardIdByName:", rval_card_id_by_name); +__merr: + err = -EINVAL; + tmp = strchr(value, '}'); + if (tmp) { + strncpy(r, value, tmp + 1 - value); + r[tmp + 1 - value] = '\0'; + uc_error("variable '%s' is not known!", r); + } else { + uc_error("variable reference '%s' is not complete", value); + } + goto __error; +__match2: + tmp = strchr(value + idsize, '}'); + if (tmp) { + rvalsize = tmp - (value + idsize); + if (rvalsize > sizeof(v2)) { + err = -ENOMEM; + goto __error; + } + strncpy(v2, value + idsize, rvalsize); + v2[rvalsize] = '\0'; + idsize += rvalsize + 1; + if (*v2 == '$' && uc_mgr->conf_format >= 3) { + tmp = uc_mgr_get_variable(uc_mgr, v2 + 1); + if (tmp == NULL) { + uc_error("define '%s' is not reachable in this context!", v2 + 1); + rval = NULL; + } else { + rval = fcn2(uc_mgr, tmp); + } } else { - uc_error("variable reference '%s' is not complete", value); + rval = fcn2(uc_mgr, v2); } - goto __error; + goto __rval; + } + goto __merr; __rval: - if (rval == NULL || (!allow_empty && rval[0] == '\0')) { + if (rval == NULL || (!allow_empty && rval[0] == '\0')) { + free(rval); + if (ignore_error) { + value += idsize; + continue; + } + strncpy(r, value, idsize); + r[idsize] = '\0'; + uc_error("variable '%s' is not defined in this context!", r); + err = -EINVAL; + goto __error; + } + value += idsize; + rvalsize = strlen(rval); + nsize = size + rvalsize - idsize; + if (nsize > size) { + nr = realloc(r, nsize); + if (nr == NULL) { free(rval); - strncpy(r, value, idsize); - r[idsize] = '\0'; - uc_error("variable '%s' is not defined in this context!", r); - err = -EINVAL; + err = -ENOMEM; goto __error; } - value += idsize; - rvalsize = strlen(rval); - nsize = size + rvalsize - idsize; - if (nsize > size) { - nr = realloc(r, nsize); - if (nr == NULL) { - free(rval); - err = -ENOMEM; - goto __error; - } - size = nsize; - r = nr; - } - strcpy(r + dpos, rval); - dpos += rvalsize; - free(rval); - } else { - r[dpos++] = *value; - value++; + size = nsize; + r = nr; } + strcpy(r + dpos, rval); + dpos += rvalsize; + free(rval); } r[dpos] = '\0'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alsa-lib-1.2.3/version new/alsa-lib-1.2.3.1/version --- old/alsa-lib-1.2.3/version 2020-06-08 15:07:21.000000000 +0200 +++ new/alsa-lib-1.2.3.1/version 2020-06-18 19:25:54.000000000 +0200 @@ -1 +1 @@ -1.2.3 +1.2.3.1
