Merge "SDP: Make ast_sdp_state_set_remote_sdp() return error."

pull/7/head
Jenkins2 8 years ago committed by Gerrit Code Review
commit 9af53d3563

@ -146,9 +146,12 @@ const void *ast_sdp_state_get_local_sdp_impl(struct ast_sdp_state *sdp_state);
* \param sdp_state * \param sdp_state
* \param sdp * \param sdp
* *
* \retval 0 Success
* \retval non-0 Failure
*
* \since 15 * \since 15
*/ */
void ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp); int ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp);
/*! /*!
* \brief Set the remote SDP from an Implementation * \brief Set the remote SDP from an Implementation

@ -1073,7 +1073,7 @@ const void *ast_sdp_state_get_local_sdp_impl(struct ast_sdp_state *sdp_state)
return ast_sdp_translator_from_sdp(sdp_state->translator, sdp); return ast_sdp_translator_from_sdp(sdp_state->translator, sdp);
} }
void ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp) int ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp)
{ {
ast_assert(sdp_state != NULL); ast_assert(sdp_state != NULL);
@ -1081,12 +1081,13 @@ void ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct
sdp_state->role = SDP_ROLE_ANSWERER; sdp_state->role = SDP_ROLE_ANSWERER;
} }
merge_sdps(sdp_state, sdp); return merge_sdps(sdp_state, sdp);
} }
int ast_sdp_state_set_remote_sdp_from_impl(struct ast_sdp_state *sdp_state, void *remote) int ast_sdp_state_set_remote_sdp_from_impl(struct ast_sdp_state *sdp_state, void *remote)
{ {
struct ast_sdp *sdp; struct ast_sdp *sdp;
int ret;
ast_assert(sdp_state != NULL); ast_assert(sdp_state != NULL);
@ -1094,9 +1095,9 @@ int ast_sdp_state_set_remote_sdp_from_impl(struct ast_sdp_state *sdp_state, void
if (!sdp) { if (!sdp) {
return -1; return -1;
} }
ast_sdp_state_set_remote_sdp(sdp_state, sdp); ret = ast_sdp_state_set_remote_sdp(sdp_state, sdp);
ast_sdp_free(sdp); ast_sdp_free(sdp);
return 0; return ret;
} }
int ast_sdp_state_reset(struct ast_sdp_state *sdp_state) int ast_sdp_state_reset(struct ast_sdp_state *sdp_state)

Loading…
Cancel
Save