pw-cli: don't keep doing syncs in monitor mode

In monitor mode, we only need one sync to get the prompt and then we
just wait until we need to stop. There is no need to keep on syncing
because it consumes a lot of CPU.

Patch by Hiero32

Fixes #2709
This commit is contained in:
Wim Taymans 2022-09-19 10:56:08 +02:00
parent 26e789124f
commit bdfbce8939

View file

@ -2374,8 +2374,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "Error: \"%s\"\n", error);
free(error);
}
data.current->prompt_pending = pw_core_sync(data.current->core, 0, 0);
while (!data.quit && data.current) {
data.current->prompt_pending = pw_core_sync(data.current->core, 0, 0);
pw_main_loop_run(data.loop);
if (!monitor)
break;