pulse: avoid node lookup when connecting

We can use the node name directly if we strip the .monitor suffix
or remove the MONITOR flag form the name/id.
This commit is contained in:
Wim Taymans 2020-10-24 16:58:01 +02:00
parent ec860d64cf
commit 8ac9ce7947
4 changed files with 23 additions and 25 deletions

View file

@ -26,6 +26,8 @@
#include <pulse/util.h>
#include "internal.h"
#define PA_PATH_SEP_CHAR '/'
SPA_EXPORT
@ -112,3 +114,11 @@ int pa_msleep(unsigned long t)
return nanosleep(&ts, NULL);
}
bool pa_endswith(const char *s, const char *sfx)
{
size_t l1, l2;
l1 = strlen(s);
l2 = strlen(sfx);
return l1 >= l2 && pa_streq(s + l1 - l2, sfx);
}