From f8cbde54dab2783e2c6ba699dfaee9ef51b1e098 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 6 Jul 2004 00:08:44 +0000 Subject: auth support in esound and native AUTH and SET_NAME operatins in native simple library git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@51 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pacat.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/pacat.c') diff --git a/src/pacat.c b/src/pacat.c index 32220aeb..c69148e6 100644 --- a/src/pacat.c +++ b/src/pacat.c @@ -59,18 +59,17 @@ static void stream_write_callback(struct pa_stream *s, size_t length, void *user do_write(length); } -static void stream_complete_callback(struct pa_context*c, struct pa_stream *s, void *userdata) { - assert(c); +static void stream_complete_callback(struct pa_stream*s, int success, void *userdata) { + assert(s); - if (!s) { + if (!success) { fprintf(stderr, "Stream creation failed.\n"); mainloop_api->quit(mainloop_api, 1); return; } - stream = s; - pa_stream_set_die_callback(stream, stream_die_callback, NULL); - pa_stream_set_write_callback(stream, stream_write_callback, NULL); + pa_stream_set_die_callback(s, stream_die_callback, NULL); + pa_stream_set_write_callback(s, stream_write_callback, NULL); } static void context_complete_callback(struct pa_context *c, int success, void *userdata) { @@ -87,7 +86,7 @@ static void context_complete_callback(struct pa_context *c, int success, void *u goto fail; } - if (pa_stream_new(c, PA_STREAM_PLAYBACK, NULL, "pacat", &ss, NULL, stream_complete_callback, NULL) < 0) { + if (!(stream = pa_stream_new(c, PA_STREAM_PLAYBACK, NULL, "pacat", &ss, NULL, stream_complete_callback, NULL))) { fprintf(stderr, "pa_stream_new() failed.\n"); goto fail; } -- cgit