Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
mediastreamer2
Commits
54678a7a
Commit
54678a7a
authored
Aug 24, 2012
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve ice_check_list_set_state().
parent
a3dbf60f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
src/ice.c
src/ice.c
+17
-6
No files found.
src/ice.c
View file @
54678a7a
...
...
@@ -416,17 +416,28 @@ IceCheckListState ice_check_list_state(const IceCheckList* cl)
return
cl
->
state
;
}
static
int
ice_find_
non_failed_check_list
(
const
IceCheckList
*
cl
)
static
int
ice_find_
check_list_from_state
(
const
IceCheckList
*
cl
,
const
IceCheckListState
*
state
)
{
return
(
cl
->
state
==
ICL_Failed
);
return
(
cl
->
state
==
*
state
);
}
void
ice_check_list_set_state
(
IceCheckList
*
cl
,
IceCheckListState
state
)
{
IceCheckListState
check_state
;
if
(
cl
->
state
!=
state
)
{
cl
->
state
=
state
;
if
(
ms_list_find_custom
(
cl
->
session
->
streams
,
(
MSCompareFunc
)
ice_find_non_failed_check_list
,
NULL
)
==
NULL
)
{
/* Set the state of the session to Failed if all the check lists are in the Failed state. */
check_state
=
ICL_Running
;
if
(
ms_list_find_custom
(
cl
->
session
->
streams
,
(
MSCompareFunc
)
ice_find_check_list_from_state
,
&
check_state
)
==
NULL
)
{
check_state
=
ICL_Failed
;
if
(
ms_list_find_custom
(
cl
->
session
->
streams
,
(
MSCompareFunc
)
ice_find_check_list_from_state
,
&
check_state
)
!=
NULL
)
{
/* Set the state of the session to Failed if at least one check list is in the Failed state. */
cl
->
session
->
state
=
IS_Failed
;
}
else
{
/* All the check lists are in the Completed state, set the state of the session to Completed. */
cl
->
session
->
state
=
IS_Completed
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment