mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
srtpdec: Simplify checking the unprotect error
Introduce an err label to jump to. Avoid logging two warnings per failure.
This commit is contained in:
parent
34eaeb17f2
commit
24b0e3e55f
1 changed files with 33 additions and 34 deletions
|
@ -1382,14 +1382,12 @@ unprotect:
|
|||
#endif
|
||||
}
|
||||
|
||||
if (err != srtp_err_status_ok) {
|
||||
GST_WARNING_OBJECT (pad,
|
||||
"Unable to unprotect buffer (unprotect failed code %d)", err);
|
||||
|
||||
/* Signal user depending on type of error */
|
||||
switch (err) {
|
||||
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);
|
||||
|
@ -1405,25 +1403,26 @@ unprotect:
|
|||
GST_WARNING_OBJECT (filter, "Could not find matching stream, "
|
||||
"dropping");
|
||||
}
|
||||
break;
|
||||
goto err;
|
||||
case srtp_err_status_auth_fail:
|
||||
GST_WARNING_OBJECT (filter, "Error authentication packet, dropping");
|
||||
break;
|
||||
goto err;
|
||||
case srtp_err_status_cipher_fail:
|
||||
GST_WARNING_OBJECT (filter, "Error while decrypting packet, dropping");
|
||||
break;
|
||||
goto err;
|
||||
default:
|
||||
GST_WARNING_OBJECT (filter, "Other error, dropping");
|
||||
break;
|
||||
}
|
||||
|
||||
gst_buffer_unmap (buf, &map);
|
||||
return FALSE;
|
||||
GST_WARNING_OBJECT (pad,
|
||||
"Unable to unprotect buffer (unprotect failed code %d)", err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
gst_buffer_unmap (buf, &map);
|
||||
gst_buffer_set_size (buf, size);
|
||||
return TRUE;
|
||||
|
||||
err:
|
||||
gst_buffer_unmap (buf, &map);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
Loading…
Reference in a new issue