[pulseaudio-discuss] A few questions about termination
Lennart Poettering
lennart at poettering.net
Fri Jul 24 04:03:22 PDT 2009
On Fri, 24.07.09 11:17, Andreas Öman (andreas at lonelycoder.com) wrote:
> Hi,
>
> If my application receives a PA_CONTEXT_TERMINATED or PA_CONTEXT_FAILED
> event, will all the active streams be automatically destroyed by the
> library or do I have to do that myself?
No. Stream state changes do not result in freeing of any
resources. You always have to drop all references you are keeping
(with pa_stream_unref()) before resources are freed.
> Second, If I chose 'terminate' from pavucontrol on my application's
> stream the app receives an PA_STREAM_FAILED event. I would expect
> it to be PA_STREAM_TERMINATED.
The PA_STREAM_TERMINATED state is only entered if you locally change
terminate a stream by calling pa_stream_disconnect(). Any error or
externally triggered state change is forward to you as a
PA_STREAM_FAILED state.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list