From 2070ad37dff392187857f9b9102639a636e6d104 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 9 Dec 2019 12:27:01 +0100 Subject: [PATCH] example: handle connect error --- src/examples/audio-dsp-filter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/examples/audio-dsp-filter.c b/src/examples/audio-dsp-filter.c index 3b9d0f703..72f65b68e 100644 --- a/src/examples/audio-dsp-filter.c +++ b/src/examples/audio-dsp-filter.c @@ -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);