SHA256
1
0
forked from pool/alsa-utils
OBS User unknown 2007-08-15 11:02:15 +00:00 committed by Git OBS Bridge
parent a9660d0985
commit db77029669
3 changed files with 74 additions and 11 deletions

View File

@ -1,6 +1,6 @@
diff -r 0c395cb93191 alsaconf/alsaconf.in
--- a/alsaconf/alsaconf.in Thu May 31 08:55:26 2007 +0200
+++ b/alsaconf/alsaconf.in Wed Jul 25 02:01:08 2007 +0200
+++ b/alsaconf/alsaconf.in Tue Aug 14 16:31:00 2007 +0200
@@ -896,7 +896,7 @@ BEGIN { in_sound=0; }
# set up /etc/sysconfig/hardware/*
if [ "$distribution" = "suse" ]; then
@ -12,8 +12,54 @@ diff -r 0c395cb93191 alsaconf/alsaconf.in
esac
diff -r 0c395cb93191 amixer/amixer.c
--- a/amixer/amixer.c Thu May 31 08:55:26 2007 +0200
+++ b/amixer/amixer.c Wed Jul 25 02:01:08 2007 +0200
@@ -1369,67 +1369,35 @@ static int get_enum_item_index(snd_mixer
+++ b/amixer/amixer.c Tue Aug 14 16:31:00 2007 +0200
@@ -1154,6 +1154,34 @@ static int parse_simple_id(const char *s
return 0;
}
+static int get_ctl_enum_item_index(snd_ctl_t *handle, snd_ctl_elem_info_t *info,
+ char **ptrp)
+{
+ char *ptr = *ptrp;
+ int items, i, len;
+ const char *name;
+
+ items = snd_ctl_elem_info_get_items(info);
+ if (items <= 0)
+ return -1;
+
+ for (i = 0; i < items; i++) {
+ snd_ctl_elem_info_set_item(info, i);
+ if (snd_ctl_elem_info(handle, info) < 0)
+ return -1;
+ name = snd_ctl_elem_info_get_item_name(info);
+ len = strlen(name);
+ if (! strncmp(name, ptr, len)) {
+ if (! ptr[len] || ptr[len] == ',' || ptr[len] == '\n') {
+ ptr += len;
+ *ptrp = ptr;
+ return i;
+ }
+ }
+ }
+ return -1;
+}
+
static int cset(int argc, char *argv[], int roflag, int keep_handle)
{
int err;
@@ -1242,7 +1270,9 @@ static int cset(int argc, char *argv[],
snd_ctl_elem_value_set_integer64(control, idx, tmp);
break;
case SND_CTL_ELEM_TYPE_ENUMERATED:
- tmp = get_integer(&ptr, 0, snd_ctl_elem_info_get_items(info) - 1);
+ tmp = get_ctl_enum_item_index(handle, info, &ptr);
+ if (tmp < 0)
+ tmp = get_integer(&ptr, 0, snd_ctl_elem_info_get_items(info) - 1);
snd_ctl_elem_value_set_enumerated(control, idx, tmp);
break;
case SND_CTL_ELEM_TYPE_BYTES:
@@ -1369,67 +1399,35 @@ static int get_enum_item_index(snd_mixer
return -1;
}
@ -108,7 +154,7 @@ diff -r 0c395cb93191 amixer/amixer.c
for (idx = 1; idx < argc; idx++) {
char *ptr = argv[idx], *optr;
int multi, firstchn = 1;
@@ -1447,19 +1415,6 @@ static int sset(unsigned int argc, char
@@ -1447,19 +1445,6 @@ static int sset(unsigned int argc, char
if (!(channels & (1 << chn)))
continue;
@ -128,7 +174,7 @@ diff -r 0c395cb93191 amixer/amixer.c
if ((dir & 1) && snd_mixer_selem_has_playback_channel(elem, chn)) {
sptr = ptr;
@@ -1540,35 +1495,94 @@ static int sset(unsigned int argc, char
@@ -1540,35 +1525,94 @@ static int sset(unsigned int argc, char
if (dir & 2)
error("Unknown capture setup '%s'..", ptr);
}
@ -238,7 +284,7 @@ diff -r 0c395cb93191 amixer/amixer.c
static void events_info(snd_hctl_elem_t *helem)
diff -r 0c395cb93191 aplay/Makefile.am
--- a/aplay/Makefile.am Thu May 31 08:55:26 2007 +0200
+++ b/aplay/Makefile.am Wed Jul 25 02:01:08 2007 +0200
+++ b/aplay/Makefile.am Tue Aug 14 16:31:00 2007 +0200
@@ -1,5 +1,5 @@ INCLUDES = -I$(top_srcdir)/include
INCLUDES = -I$(top_srcdir)/include
-LDADD = -lasound $(LIBINTL)
@ -248,8 +294,16 @@ diff -r 0c395cb93191 aplay/Makefile.am
#LDFLAGS = -static
diff -r 0c395cb93191 aplay/aplay.c
--- a/aplay/aplay.c Thu May 31 08:55:26 2007 +0200
+++ b/aplay/aplay.c Wed Jul 25 02:01:08 2007 +0200
@@ -322,7 +322,7 @@ static void signal_handler(int sig)
+++ b/aplay/aplay.c Tue Aug 14 16:31:00 2007 +0200
@@ -37,6 +37,7 @@
#include <ctype.h>
#include <errno.h>
#include <limits.h>
+#include <time.h>
#include <locale.h>
#include <alsa/asoundlib.h>
#include <assert.h>
@@ -322,7 +323,7 @@ static void signal_handler(int sig)
close(fd);
fd = -1;
}
@ -258,7 +312,7 @@ diff -r 0c395cb93191 aplay/aplay.c
snd_pcm_close(handle);
handle = NULL;
}
@@ -1215,10 +1215,10 @@ static void compute_max_peak(u_char *dat
@@ -1215,10 +1216,10 @@ static void compute_max_peak(u_char *dat
putchar('\r');
for (val = 0; val <= perc / 2 && val < 50; val++)
putchar('#');
@ -273,7 +327,7 @@ diff -r 0c395cb93191 aplay/aplay.c
printf("| %02i%%", maxperc);
diff -r 0c395cb93191 speaker-test/Makefile.am
--- a/speaker-test/Makefile.am Thu May 31 08:55:26 2007 +0200
+++ b/speaker-test/Makefile.am Wed Jul 25 02:01:08 2007 +0200
+++ b/speaker-test/Makefile.am Tue Aug 14 16:31:00 2007 +0200
@@ -1,6 +1,6 @@ INCLUDES = -I$(top_srcdir)/include
INCLUDES = -I$(top_srcdir)/include
SUBDIRS= samples

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Aug 14 16:31:30 CEST 2007 - tiwai@suse.de
- amixer - Allow to pass enum item string for cset, too
- aplay - Include missing time.h for time()
-------------------------------------------------------------------
Mon Jul 30 19:01:41 CEST 2007 - tiwai@suse.de

View File

@ -20,7 +20,7 @@ Requires: dialog pciutils
Autoreqprov: on
Summary: Advanced Linux Sound Architecture Utilities
Version: 1.0.14
Release: 13
Release: 17
Source: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
Patch: alsa-utils-hg-fixes.diff
URL: http://www.alsa-project.org/
@ -69,6 +69,9 @@ make DESTDIR=$RPM_BUILD_ROOT install
%{_datadir}/alsa
%changelog
* Tue Aug 14 2007 - tiwai@suse.de
- amixer - Allow to pass enum item string for cset, too
- aplay - Include missing time.h for time()
* Mon Jul 30 2007 - tiwai@suse.de
- HG fixes (as of 2007.07.28)
* don't install hwcfg file for openSUSE 10.3 in alsaconf