Update of /cvsroot/alsa/alsa-lib/src/pcm/ext In directory sc8-pr-cvs1:/tmp/cvs-serv4450
Modified Files: pcm_jack.c Log Message: More cleanups Index: pcm_jack.c =================================================================== RCS file: /cvsroot/alsa/alsa-lib/src/pcm/ext/pcm_jack.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- pcm_jack.c 5 Mar 2003 19:56:59 -0000 1.1 +++ pcm_jack.c 8 Mar 2003 16:32:38 -0000 1.2 @@ -204,7 +204,7 @@ unsigned int channel; #ifdef PCM_JACK_DEBUG - printf("PROCESS %d!\n",jack->state); + printf("PROCESS %d! (%u)\n",jack->state, (unsigned)nframes); #endif for (channel = 0; channel < jack->channels; channel++) { @@ -342,7 +342,7 @@ jack_port_name (jack->ports[i]), jack->playback_ports[i])) { - fprintf(stderr, "cannot connect %s to %s", + fprintf(stderr, "cannot connect %s to %s\n", jack_port_name(jack->ports[i]), jack->playback_ports[i]); return -EIO; @@ -363,7 +363,7 @@ jack->capture_ports[i], jack_port_name (jack->ports[i]))) { - fprintf(stderr, "cannot connect %s to %s", + fprintf(stderr, "cannot connect %s to %s\n", jack->capture_ports[i], jack_port_name(jack->ports[i])); return -EIO; @@ -401,12 +401,15 @@ printf("deactivate done\n"); jack->activated = 0; } + { + unsigned i; for (i = 0; i < pcm->channels; i++) { if (jack->ports[i]) { jack_port_unregister(jack->client, jack->ports[i]); jack->ports[i] = NULL; } } + } #endif jack->state = SND_PCM_STATE_SETUP; return 0; @@ -510,7 +513,7 @@ (1<<SNDRV_PCM_ACCESS_RW_INTERLEAVED) | (1<<SNDRV_PCM_ACCESS_RW_NONINTERLEAVED), 0, 0, 0 } }; - static snd_pcm_format_mask_t format_mask = { SND_PCM_FMTBIT_FLOAT }; + static snd_pcm_format_mask_t format_mask = { { 1U<<SNDRV_PCM_FORMAT_FLOAT } }; snd_interval_t t; #ifdef PCM_JACK_DEBUG @@ -710,13 +713,11 @@ jack->capture_ports = NULL; jack->capture_ports_n = 0; - err = parse_ports(playback_conf, - &jack->playback_ports,&jack->playback_ports_n); + err = parse_ports(playback_conf, &jack->playback_ports,&jack->playback_ports_n); if (err) goto _free; - err = parse_ports(capture_conf, - &jack->capture_ports,&jack->capture_ports_n); + err = parse_ports(capture_conf, &jack->capture_ports,&jack->capture_ports_n); if (err) goto _free; @@ -729,6 +730,10 @@ jack->client = jack_client_new("alsaC"); } + if (jack->channels == 0) { + SNDERR("define the %s_ports section\n", stream == SND_PCM_STREAM_PLAYBACK ? "playback" : "capture"); + goto _free; + } if (jack->client==0) { err = -ENOENT; @@ -765,6 +770,8 @@ _free: if (jack) { + if (jack->client) + jack_client_close(jack->client); if (jack->playback_ports) { unsigned int k; ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog