screencast: fix check on loop_iterate

According to the documentation [1] pw_loop_iterate (a macro for
spa_loop_control_iterate) will return the number of dispatched fd's
and thus we should check only negative return values.

[1] https://docs.pipewire.org/group__spa__loop.html#ga3bae0b32100f5752b3372a505c8e04f6
This commit is contained in:
columbarius 2022-01-18 02:42:52 +01:00 committed by Simon Ser
parent 55d73ab647
commit c34d09877c
1 changed files with 2 additions and 1 deletions

View File

@ -432,8 +432,9 @@ static int method_screencast_start(sd_bus_message *msg, void *data,
while (cast->node_id == SPA_ID_INVALID) {
int ret = pw_loop_iterate(state->pw_loop, 0);
if (ret != 0) {
if (ret < 0) {
logprint(ERROR, "pipewire_loop_iterate failed: %s", spa_strerror(ret));
return ret;
}
}