example: handle connect error

This commit is contained in:
Wim Taymans 2019-12-09 12:27:01 +01:00
parent 181c2de2ee
commit 2070ad37df

View file

@ -135,7 +135,10 @@ int main(int argc, char *argv[])
/* Now connect this filter. We ask that our process function is
* called in a realtime thread. */
pw_filter_connect(data.filter, PW_FILTER_FLAG_RT_PROCESS, NULL, 0);
if (pw_filter_connect(data.filter, PW_FILTER_FLAG_RT_PROCESS, NULL, 0) < 0) {
fprintf(stderr, "can't connect\n");
return -1;
}
/* and wait while we let things run */
pw_main_loop_run(data.loop);