17 Jun
2009
17 Jun
'09
11:37 p.m.
On Wed, 17.06.09 21:55, Troy Moure (twmoure@szypr.net) wrote:
Just cork or uncork the stream to pause or unpause it.
Looks mostly good to me, but:
+static int pulse_pause(snd_pcm_ioplug_t * io, int enable) +{
- snd_pcm_pulse_t *pcm = io->private_data;
- int err = 0;
- assert (pcm);
- assert (pcm->p);
- pa_threaded_mainloop_lock(pcm->p->mainloop);
- if (pcm->stream)
if (!pa_stream_cork(pcm->stream, enable, NULL, NULL))
err = -EIO;
pa_stream_cork() will return a pa_operation object on success. The least you need to do is call pa_operation_unref() on it, which you can safely do right-away. Otherwise this will leak memory.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4