Commit 6eb3fc68 authored by Youness Alaoui's avatar Youness Alaoui

Refactor nice_agent_set_stream_tos to use agent_find_stream internal API

parent 635da750
...@@ -2958,25 +2958,27 @@ NICEAPI_EXPORT void ...@@ -2958,25 +2958,27 @@ NICEAPI_EXPORT void
nice_agent_set_stream_tos (NiceAgent *agent, nice_agent_set_stream_tos (NiceAgent *agent,
guint stream_id, gint tos) guint stream_id, gint tos)
{ {
GSList *i, *j, *k; GSList *i, *j;
Stream *stream;
agent_lock(); agent_lock();
for (i = agent->streams; i; i = i->next) { stream = agent_find_stream (agent, stream_id);
Stream *stream = i->data; if (stream == NULL)
if (stream->id == stream_id) { goto done;
stream->tos = tos; stream->tos = tos;
for (j = stream->components; j; j = j->next) { for (i = stream->components; i; i = i->next) {
Component *component = j->data; Component *component = i->data;
for (j = component->local_candidates; j; j = j->next) {
NiceCandidate *local_candidate = j->data;
for (k = component->local_candidates; k; k = k->next) {
NiceCandidate *local_candidate = k->data;
_priv_set_socket_tos (agent, local_candidate->sockptr, tos); _priv_set_socket_tos (agent, local_candidate->sockptr, tos);
} }
} }
}
}
done:
agent_unlock(); agent_unlock();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment