mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pw-link: move output/input option checking before main event loop run
This commit is contained in:
parent
0b67c10a9c
commit
e8d104f7bc
1 changed files with 6 additions and 5 deletions
|
|
@ -794,6 +794,12 @@ int main(int argc, char *argv[])
|
|||
if (optind < argc)
|
||||
data.opt_input = argv[optind++];
|
||||
|
||||
if ((data.opt_mode & (MODE_LIST|MODE_DISCONNECT)) == 0 &&
|
||||
(data.opt_output == NULL || data.opt_input == NULL)) {
|
||||
fprintf(stderr, "missing output and input port names to connect\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
data.loop = pw_main_loop_new(NULL);
|
||||
if (data.loop == NULL) {
|
||||
fprintf(stderr, "can't create mainloop: %m\n");
|
||||
|
|
@ -861,11 +867,6 @@ int main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (data.opt_output == NULL ||
|
||||
data.opt_input == NULL) {
|
||||
fprintf(stderr, "missing output and input port names to connect\n");
|
||||
return -1;
|
||||
}
|
||||
if ((res = do_link_ports(&data)) < 0) {
|
||||
fprintf(stderr, "failed to link ports: %s\n", spa_strerror(res));
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue