+ id->srtp = NULL;
+ id->pf_packetize = NULL;
+
+ char *key = var_CreateGetNonEmptyString (p_stream, SOUT_CFG_PREFIX"key");
+ if (key)
+ {
+ id->srtp = srtp_create (SRTP_ENCR_AES_CM, SRTP_AUTH_HMAC_SHA1, 10,
+ SRTP_PRF_AES_CM, SRTP_RCC_MODE1);
+ if (id->srtp == NULL)
+ {
+ free (key);
+ goto error;
+ }
+
+ char *salt = var_CreateGetNonEmptyString (p_stream, SOUT_CFG_PREFIX"salt");
+ errno = srtp_setkeystring (id->srtp, key, salt ? salt : "");
+ free (salt);
+ free (key);
+ if (errno)
+ {
+ msg_Err (p_stream, "bad SRTP key/salt combination (%m)");
+ goto error;
+ }
+ id->i_sequence = 0; /* FIXME: awful hack for libvlc_srtp */
+ }
+