paplay: check if pa_context_connect() succeed

This commit is contained in:
Marc-André Lureau 2009-02-17 20:27:45 +02:00 committed by Lennart Poettering
parent 6c8d851643
commit 2aeab75c68

View file

@ -400,7 +400,10 @@ int main(int argc, char *argv[]) {
pa_context_set_state_callback(context, context_state_callback, NULL); pa_context_set_state_callback(context, context_state_callback, NULL);
/* Connect the context */ /* Connect the context */
pa_context_connect(context, server, 0, NULL); if (pa_context_connect(context, server, 0, NULL) < 0) {
fprintf(stderr, _("pa_context_connect() failed: %s"), pa_strerror(pa_context_errno(context)));
goto quit;
}
/* Run the main loop */ /* Run the main loop */
if (pa_mainloop_run(m, &ret) < 0) { if (pa_mainloop_run(m, &ret) < 0) {