summaryrefslogtreecommitdiffstats
path: root/jack/pcm_jack.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-04-12 12:36:13 +0200
committerTakashi Iwai <tiwai@suse.de>2006-04-12 12:36:13 +0200
commit608a7e6cc73157a1a20af4de23381e455399df0a (patch)
treea748a906bf0ca590ab7d89aaccf49717239d5eac /jack/pcm_jack.c
parentd99528f70f566373029fdbab0cd621469be80a99 (diff)
jack plugin closes stdin if jack is unavailable
the jack plugin closes stdin if the pcm interfaces is opened but jack isn't running. Initializing the file descriptors to -1 fixes the problem. From: Mikael Magnusson <mikma264@gmail.com>
Diffstat (limited to 'jack/pcm_jack.c')
-rw-r--r--jack/pcm_jack.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c
index 31cf050..4350302 100644
--- a/jack/pcm_jack.c
+++ b/jack/pcm_jack.c
@@ -61,8 +61,10 @@ static void snd_pcm_jack_free(snd_pcm_jack_t *jack)
free(jack->port_names[i]);
free(jack->port_names);
}
- close(jack->fd);
- close(jack->io.poll_fd);
+ if (jack->fd >= 0)
+ close(jack->fd);
+ if (jack->io.poll_fd >= 0)
+ close(jack->io.poll_fd);
free(jack->areas);
free(jack);
}
@@ -321,6 +323,9 @@ static int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
if (!jack)
return -ENOMEM;
+ jack->fd = -1;
+ jack->io.poll_fd = -1;
+
err = parse_ports(jack, stream == SND_PCM_STREAM_PLAYBACK ?
playback_conf : capture_conf);
if (err) {