summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2015-04-22 17:32:58 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2015-04-22 17:32:58 -0400
commit73926858b85a03b9782da5199faa70988c8126df (patch)
treeec569d7dcf7f198502bba04553f9ae2a3acccebb
parente3860ddfb5667de8f3f9be27838ea7e4152faf01 (diff)
downloadlibnice-73926858b85a03b9782da5199faa70988c8126df.tar.gz
agent: Fix SDP line counting
Fixes SDP parsing which I broke in commit 5972db04
-rw-r--r--agent/agent.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 126316a..da7d202 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -5654,7 +5654,7 @@ nice_agent_parse_remote_sdp (NiceAgent *agent, const gchar *sdp)
{
Stream *current_stream = NULL;
gchar **sdp_lines = NULL;
- GSList *l, *stream_item;
+ GSList *l, *stream_item = NULL;
gint i;
gint ret = 0;
@@ -5673,11 +5673,12 @@ nice_agent_parse_remote_sdp (NiceAgent *agent, const gchar *sdp)
}
sdp_lines = g_strsplit (sdp, "\n", 0);
- stream_item = agent->streams;
- current_stream = stream_item->data;
for (i = 0; sdp_lines && sdp_lines[i]; i++) {
if (g_str_has_prefix (sdp_lines[i], "m=")) {
- stream_item = stream_item->next;
+ if (stream_item == NULL)
+ stream_item = agent->streams;
+ else
+ stream_item = stream_item->next;
if (!stream_item) {
g_critical("More streams in SDP than in agent");
ret = -1;