Re: [PATCH] alsa-plugins/pulse: Implement 'pause'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 17.06.09 21:55, Troy Moure (twmoure@xxxxxxxxx) 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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux