media-session: sanitize name and nick

Replace unwanted chars in the name with _. This makes it compatible
with pulseaudio names and avoids problems with regex.
Replace unwanred chars in the nick with ' '. This ensures JACK
clients don't receive ':' in the device names, which cause it to
fail when parsing the ports.

See #714 and #130
This commit is contained in:
Wim Taymans 2021-02-12 20:47:41 +01:00
parent ac910c7c1c
commit 062911640c
5 changed files with 55 additions and 10 deletions

View file

@ -300,6 +300,9 @@ int sm_media_session_save_state(struct sm_media_session *sess,
int sm_media_session_match_rules(const char *rules, size_t size,
struct pw_properties *props);
char *sm_media_session_sanitize_name(char *name, int size, char sub,
const char *fmt, ...) SPA_PRINTF_FUNC(4, 5);
#ifdef __cplusplus
}
#endif