forked from pool/alsa-utils
Takashi Iwai
3331bcfb82
* A few alsactl init fix patches: * amixer control-id parse fix * new aloop utility * robusitfy speaker-test * misc clean up, translation updates - Use systemd for openSUSE 11.4 - Put udev rules into this package instead of alsa.rpm OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=23
46 lines
1.5 KiB
Diff
46 lines
1.5 KiB
Diff
From ad0e562373af1de5e911cf1d5def598a7b6523f2 Mon Sep 17 00:00:00 2001
|
|
From: Jaroslav Kysela <perex@perex.cz>
|
|
Date: Wed, 6 Oct 2010 18:30:18 +0200
|
|
Subject: [PATCH 18/38] alsaloop: Fix loopbacks pointer initialization and allocation, fix -T option
|
|
|
|
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
---
|
|
alsaloop/alsaloop.c | 7 ++++---
|
|
1 files changed, 4 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
|
|
index 4ba5203..0001358 100644
|
|
--- a/alsaloop/alsaloop.c
|
|
+++ b/alsaloop/alsaloop.c
|
|
@@ -45,7 +45,7 @@ struct loopback_thread {
|
|
int verbose = 0;
|
|
int daemonize = 0;
|
|
int use_syslog = 0;
|
|
-struct loopback **loopbacks;
|
|
+struct loopback **loopbacks = NULL;
|
|
int loopbacks_count = 0;
|
|
|
|
static void my_exit(struct loopback_thread *thread, int exitcode)
|
|
@@ -199,7 +199,8 @@ static long timediff(struct timeval t1, struct timeval t2)
|
|
|
|
static void add_loop(struct loopback *loop)
|
|
{
|
|
- loopbacks = realloc(loopbacks, loopbacks_count * sizeof(struct loopback *));
|
|
+ loopbacks = realloc(loopbacks, (loopbacks_count + 1) *
|
|
+ sizeof(struct loopback *));
|
|
if (loopbacks == NULL) {
|
|
logit(LOG_CRIT, "No enough memory\n");
|
|
exit(EXIT_FAILURE);
|
|
@@ -321,7 +322,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
|
|
morehelp = 0;
|
|
while (1) {
|
|
int c;
|
|
- if ((c = getopt_long(argc, argv, "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:", long_option, NULL)) < 0)
|
|
+ if ((c = getopt_long(argc, argv, "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:T:", long_option, NULL)) < 0)
|
|
break;
|
|
switch (c) {
|
|
case 'h':
|
|
--
|
|
1.7.3.1
|
|
|