diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-15 16:12:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-15 16:12:24 +0100 |
commit | 77041e2474a107bb86259ab2c8b1bc6600ed093f (patch) | |
tree | 277dab3d3787cb6e12441f465c4881baf03bf1b4 /libavformat/sdp.c | |
parent | b52925d2cde98b2a3ffaf451248191c8627d356a (diff) | |
parent | 094a7405e5d8463d7d167d893e04934ec1a84ecd (diff) | |
download | ffmpeg-77041e2474a107bb86259ab2c8b1bc6600ed093f.tar.gz |
Merge commit '094a7405e5d8463d7d167d893e04934ec1a84ecd'
* commit '094a7405e5d8463d7d167d893e04934ec1a84ecd':
x86: ABSB: port to cpuflags
sdp: Include SRTP crypto params if using the srtp protocol
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r-- | libavformat/sdp.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c index cdc3e212ef..0124218495 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); + } } } |