diff --git a/daemon/sdp.c b/daemon/sdp.c index 8d6a54f03..d5ed5fab3 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -702,6 +702,9 @@ static int parse_attribute_candidate(struct sdp_attribute *output, bool extended return 0; } +// 0 = success +// -1 = error +// 1 = parsed ok but unsupported candidate type int sdp_parse_candidate(struct ice_candidate *cand, const str *s) { struct sdp_attribute attr = { .value = *s, @@ -710,7 +713,7 @@ int sdp_parse_candidate(struct ice_candidate *cand, const str *s) { if (parse_attribute_candidate(&attr, true)) return -1; if (!attr.u.candidate.parsed) - return -1; + return 1; *cand = attr.u.candidate.cand_parsed; return 0; diff --git a/include/sdp.h b/include/sdp.h index e8c8491fd..857b50470 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -28,7 +28,7 @@ int sdp_replace(struct sdp_chopper *, GQueue *, struct call_monologue *, struct int sdp_is_duplicate(GQueue *sessions); int sdp_create(str *out, struct call_monologue *, struct sdp_ng_flags *flags); -int sdp_parse_candidate(struct ice_candidate *cand, const str *s); +int sdp_parse_candidate(struct ice_candidate *cand, const str *s); // returns -1, 0, 1 struct sdp_chopper *sdp_chopper_new(str *input); void sdp_chopper_destroy(struct sdp_chopper *chop);