mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
srtpdec: Simplify code flow handling status_key_expired
Ensures a balanced UNLOCK -> LOCK.
This commit is contained in:
parent
24b0e3e55f
commit
8ef4d01f60
1 changed files with 21 additions and 16 deletions
|
@ -1387,23 +1387,28 @@ unprotect:
|
|||
case srtp_err_status_ok:
|
||||
/* success! */
|
||||
break;
|
||||
case srtp_err_status_key_expired:
|
||||
/* Update stream */
|
||||
if (find_stream_by_ssrc (filter, ssrc)) {
|
||||
GST_OBJECT_UNLOCK (filter);
|
||||
if (request_key_with_signal (filter, ssrc, SIGNAL_HARD_LIMIT)) {
|
||||
GST_OBJECT_LOCK (filter);
|
||||
goto unprotect;
|
||||
} else {
|
||||
GST_OBJECT_LOCK (filter);
|
||||
GST_WARNING_OBJECT (filter, "Hard limit reached, no new key, "
|
||||
"dropping");
|
||||
}
|
||||
} else {
|
||||
GST_WARNING_OBJECT (filter, "Could not find matching stream, "
|
||||
"dropping");
|
||||
case srtp_err_status_key_expired:{
|
||||
GstSrtpDecSsrcStream *stream;
|
||||
|
||||
/* Check we have an existing stream to rekey */
|
||||
stream = find_stream_by_ssrc (filter, ssrc);
|
||||
if (stream == NULL) {
|
||||
GST_WARNING_OBJECT (filter, "Could not find matching stream, dropping");
|
||||
goto err;
|
||||
}
|
||||
goto err;
|
||||
|
||||
GST_OBJECT_UNLOCK (filter);
|
||||
stream = request_key_with_signal (filter, ssrc, SIGNAL_HARD_LIMIT);
|
||||
GST_OBJECT_LOCK (filter);
|
||||
|
||||
/* Check we have a new stream for the key request */
|
||||
if (stream == NULL) {
|
||||
GST_WARNING_OBJECT (filter, "Hard limit reached, no new key, dropping");
|
||||
goto err;
|
||||
}
|
||||
|
||||
goto unprotect;
|
||||
}
|
||||
case srtp_err_status_auth_fail:
|
||||
GST_WARNING_OBJECT (filter, "Error authentication packet, dropping");
|
||||
goto err;
|
||||
|
|
Loading…
Reference in a new issue