[FFmpeg-devel] [PATCH v5 12/15] avformat/tls_openssl: directly use mtu in TLSShared

Timo Rothenpieler timo at rothenpieler.org
Tue Jul 22 15:43:50 EEST 2025


On 22/07/2025 14:36, Jack Lau wrote:
> Openssl 1.1.0 version haven't DTLS_get_data_mtu API
> 
> Signed-off-by: Jack Lau <jacklau1222 at qq.com>
> ---
>   libavformat/tls_openssl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
> index fa852aac18..54860857c0 100644
> --- a/libavformat/tls_openssl.c
> +++ b/libavformat/tls_openssl.c
> @@ -1013,7 +1013,7 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size)
>       uc->flags |= h->flags & AVIO_FLAG_NONBLOCK;
>   
>       if (c->tls_shared.is_dtls)
> -        size = FFMIN(size, DTLS_get_data_mtu(c->ssl));
> +        size = FFMIN(size, c->tls_shared.mtu);

This is not the same value, no.
DTLS_get_data_mtu returns the mtu minus the size of the DTLS header and 
footer, i.e. the maximum amount of data it can consume.
Which is exactly what it's used for here.


More information about the ffmpeg-devel mailing list