Skip to contentSkip to conversation

jack plugin closes stdin if jack is unavailable

PATCH Applied Mikael Magnusson 2 participants 2 messages Apr 11, 2006 – Apr 12, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jack plugin closes stdin if jack is unavailable

Hi,

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.

/Mikael

pcm_jack.c 11 Apr 2006 22:02:15 -0000 renamed from pcm_jack.c 21 Mar 2006 11:51:23 -0000 1.2 +7 -2
diff -u -u -r1.2 pcm_jack.c
@@ -61,8 +61,10 @@
                                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 @@
        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) {

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

Applied
#1 lore raw

At Wed, 12 Apr 2006 00:07:08 +0200,

Quoted 5 lines · Mikael Magnusson

Hi,

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.

Thanks, applied to CVS.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642