Logo Search packages:      
Sourcecode: pulseaudio version File versions

void pa_stream_set_suspended_callback ( pa_stream p,
pa_stream_notify_cb_t  cb,
void *  userdata 
)

Set the callback function that is called whenever the sink/source this stream is connected to is suspended or resumed. Use pa_stream_is_suspended() to query the new suspend status. Please note that the suspend status might also change when the stream is moved between devices. Thus if you call this function you very likely want to call pa_stream_set_moved_callback, too. This notification is only generated when the server is at least 0.9.8.

Since:
0.9.8

Definition at line 1916 of file stream.c.

References PA_STREAM_FAILED, and PA_STREAM_TERMINATED.

                                                                                              {
    pa_assert(s);
    pa_assert(PA_REFCNT_VALUE(s) >= 1);

    if (pa_detect_fork())
        return;

    if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
        return;

    s->suspended_callback = cb;
    s->suspended_userdata = userdata;
}


Generated by  Doxygen 1.6.0   Back to index