X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsdp.c;h=01242184958c34d683799269f45521c7643534af;hb=1b03e09198e5db75064b202e00bd77f84fa47063;hp=cdc3e212efe72d6576d8cbbfaf34a03df7e3aa56;hpb=32cf37d097db526c1e42810f04463b78bb6306f2;p=ffmpeg diff --git a/libavformat/sdp.c b/libavformat/sdp.c index cdc3e212efe..01242184958 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -128,7 +128,7 @@ static int sdp_get_address(char *dest_addr, int size, int *ttl, const char *url) *ttl = 0; - if (strcmp(proto, "rtp")) { + if (strcmp(proto, "rtp") && strcmp(proto, "srtp")) { /* The url isn't for the actual rtp sessions, * don't parse out anything else than the destination. */ @@ -681,6 +681,19 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) av_strlcatf(buf, size, "a=control:streamid=%d\r\n", i + j); } + if (ac[i]->pb && ac[i]->pb->av_class) { + uint8_t *crypto_suite = NULL, *crypto_params = NULL; + av_opt_get(ac[i]->pb, "srtp_out_suite", AV_OPT_SEARCH_CHILDREN, + &crypto_suite); + av_opt_get(ac[i]->pb, "srtp_out_params", AV_OPT_SEARCH_CHILDREN, + &crypto_params); + if (crypto_suite && crypto_suite[0]) + av_strlcatf(buf, size, + "a=crypto:1 %s inline:%s\r\n", + crypto_suite, crypto_params); + av_free(crypto_suite); + av_free(crypto_params); + } } }