1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Refine unprotect_rtp to reuse cipher

This commit is contained in:
winlin 2021-02-07 16:04:19 +08:00
parent 719df6fa41
commit aec27450e8
2 changed files with 8 additions and 9 deletions

View file

@ -1019,10 +1019,8 @@ srs_error_t SrsSRTP::unprotect_rtp(const char* cipher, char* plaintext, int& nb_
return srs_error_new(ERROR_RTC_SRTP_UNPROTECT, "not ready");
}
memcpy(plaintext, cipher, nb_plaintext);
srtp_err_status_t r0 = srtp_err_status_ok;
if ((r0 = srtp_unprotect(recv_ctx_, plaintext, &nb_plaintext)) != srtp_err_status_ok) {
if ((r0 = srtp_unprotect(recv_ctx_, (void*)cipher, &nb_plaintext)) != srtp_err_status_ok) {
return srs_error_new(ERROR_RTC_SRTP_UNPROTECT, "rtp unprotect r0=%u", r0);
}