mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pw-link: use a simple boolean flag to control monitor mode
Monitoring does not interact with the normal modes of pw-link, so separate it from them.
This commit is contained in:
parent
241346d887
commit
8947ba504e
1 changed files with 6 additions and 6 deletions
|
|
@ -61,12 +61,12 @@ struct data {
|
||||||
#define MODE_LIST_PORTS (MODE_LIST_OUTPUT|MODE_LIST_INPUT)
|
#define MODE_LIST_PORTS (MODE_LIST_OUTPUT|MODE_LIST_INPUT)
|
||||||
#define MODE_LIST_LINKS (1<<2)
|
#define MODE_LIST_LINKS (1<<2)
|
||||||
#define MODE_LIST (MODE_LIST_PORTS|MODE_LIST_LINKS)
|
#define MODE_LIST (MODE_LIST_PORTS|MODE_LIST_LINKS)
|
||||||
#define MODE_MONITOR (1<<3)
|
#define MODE_DISCONNECT (1<<3)
|
||||||
#define MODE_DISCONNECT (1<<4)
|
|
||||||
uint32_t opt_mode;
|
uint32_t opt_mode;
|
||||||
bool opt_id;
|
bool opt_id;
|
||||||
bool opt_verbose;
|
bool opt_verbose;
|
||||||
bool opt_wait;
|
bool opt_wait;
|
||||||
|
bool opt_monitor;
|
||||||
const char *opt_output;
|
const char *opt_output;
|
||||||
const char *opt_input;
|
const char *opt_input;
|
||||||
struct pw_properties *props;
|
struct pw_properties *props;
|
||||||
|
|
@ -875,7 +875,7 @@ int main(int argc, char *argv[])
|
||||||
data.opt_mode |= MODE_LIST_LINKS;
|
data.opt_mode |= MODE_LIST_LINKS;
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
data.opt_mode |= MODE_MONITOR;
|
data.opt_monitor = true;
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
data.opt_id = true;
|
data.opt_id = true;
|
||||||
|
|
@ -911,7 +911,7 @@ int main(int argc, char *argv[])
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((data.opt_mode & MODE_MONITOR) == 0)
|
if (!data.opt_monitor)
|
||||||
pw_properties_set(data.props, PW_KEY_OBJECT_LINGER, "true");
|
pw_properties_set(data.props, PW_KEY_OBJECT_LINGER, "true");
|
||||||
|
|
||||||
if (optind < argc)
|
if (optind < argc)
|
||||||
|
|
@ -959,7 +959,7 @@ int main(int argc, char *argv[])
|
||||||
&data.registry_listener,
|
&data.registry_listener,
|
||||||
®istry_events, &data);
|
®istry_events, &data);
|
||||||
|
|
||||||
data.prefix = (data.opt_mode & MODE_MONITOR) ? "= " : "";
|
data.prefix = data.opt_monitor ? "= " : "";
|
||||||
|
|
||||||
core_sync(&data);
|
core_sync(&data);
|
||||||
pw_main_loop_run(data.loop);
|
pw_main_loop_run(data.loop);
|
||||||
|
|
@ -1011,7 +1011,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.opt_mode & MODE_MONITOR) {
|
if (data.opt_monitor) {
|
||||||
data.monitoring = true;
|
data.monitoring = true;
|
||||||
pw_main_loop_run(data.loop);
|
pw_main_loop_run(data.loop);
|
||||||
data.monitoring = false;
|
data.monitoring = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue