mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
make example code a bit more robust/change-proof
This commit is contained in:
parent
116b38c972
commit
abdffe9cbe
1 changed files with 5 additions and 5 deletions
|
|
@ -108,10 +108,10 @@ PA_C_DECL_BEGIN
|
|||
* Example:
|
||||
*
|
||||
* \code
|
||||
* static void my_drain_callback(pa_stream*s, int success, void *userdata) {
|
||||
* static void my_drain_callback(pa_stream *s, int success, void *userdata) {
|
||||
* pa_threaded_mainloop *m;
|
||||
*
|
||||
* m = (pa_threaded_mainloop*)userdata;
|
||||
* m = userdata;
|
||||
* assert(m);
|
||||
*
|
||||
* pa_threaded_mainloop_signal(m, 0);
|
||||
|
|
@ -125,7 +125,7 @@ PA_C_DECL_BEGIN
|
|||
* o = pa_stream_drain(s, my_drain_callback, m);
|
||||
* assert(o);
|
||||
*
|
||||
* while (pa_operation_get_state(o) != OPERATION_DONE)
|
||||
* while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
|
||||
* pa_threaded_mainloop_wait(m);
|
||||
*
|
||||
* pa_operation_unref(o);
|
||||
|
|
@ -167,7 +167,7 @@ PA_C_DECL_BEGIN
|
|||
* static void my_drain_callback(pa_stream*s, int success, void *userdata) {
|
||||
* pa_threaded_mainloop *m;
|
||||
*
|
||||
* m = (pa_threaded_mainloop*)userdata;
|
||||
* m = userdata;
|
||||
* assert(m);
|
||||
*
|
||||
* drain_result = &success;
|
||||
|
|
@ -183,7 +183,7 @@ PA_C_DECL_BEGIN
|
|||
* o = pa_stream_drain(s, my_drain_callback, m);
|
||||
* assert(o);
|
||||
*
|
||||
* while (pa_operation_get_state(o) != OPERATION_DONE)
|
||||
* while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
|
||||
* pa_threaded_mainloop_wait(m);
|
||||
*
|
||||
* pa_operation_unref(o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue