mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
sink: fix session ID extraction
Devices sometimes report sessions followed by ";timeout=..". Cut this off. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
06d7dce2ec
commit
5fc9133a60
1 changed files with 5 additions and 1 deletions
|
@ -141,7 +141,7 @@ static int sink_setup_fn(struct rtsp *bus, struct rtsp_message *m, void *data)
|
||||||
_rtsp_message_unref_ struct rtsp_message *rep = NULL;
|
_rtsp_message_unref_ struct rtsp_message *rep = NULL;
|
||||||
struct ctl_sink *s = data;
|
struct ctl_sink *s = data;
|
||||||
const char *session;
|
const char *session;
|
||||||
char *ns;
|
char *ns, *next;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
cli_debug("INCOMING: %s\n", rtsp_message_get_raw(m));
|
cli_debug("INCOMING: %s\n", rtsp_message_get_raw(m));
|
||||||
|
@ -154,6 +154,10 @@ static int sink_setup_fn(struct rtsp *bus, struct rtsp_message *m, void *data)
|
||||||
if (!ns)
|
if (!ns)
|
||||||
return cli_ENOMEM();
|
return cli_ENOMEM();
|
||||||
|
|
||||||
|
next = strchr(ns, ';');
|
||||||
|
if (next)
|
||||||
|
*next = '\0';
|
||||||
|
|
||||||
free(s->session);
|
free(s->session);
|
||||||
s->session = ns;
|
s->session = ns;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue