X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Ftls_mbedtls.c;h=aadf17760d66e736a7315d51e5b067ab9dc09fa3;hb=11cb635c84cd5d011abc2aade27c7498bcf29595;hp=b42b76f8dbc3ad58d6b3a777722cd9e7bda3f7ca;hpb=c24d247e2c2ccd13fda09fe4194bf2ff0eb42256;p=ffmpeg diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c index b42b76f8dbc..aadf17760d6 100644 --- a/libavformat/tls_mbedtls.c +++ b/libavformat/tls_mbedtls.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,6 +62,7 @@ static int tls_close(URLContext *h) mbedtls_ctr_drbg_free(&tls_ctx->ctr_drbg_context); mbedtls_entropy_free(&tls_ctx->entropy_context); + ffurl_closep(&tls_ctx->tls_shared.tcp); return 0; } @@ -325,6 +326,12 @@ static int tls_get_file_handle(URLContext *h) return ffurl_get_file_handle(c->tls_shared.tcp); } +static int tls_get_short_seek(URLContext *h) +{ + TLSContext *s = h->priv_data; + return ffurl_get_short_seek(s->tls_shared.tcp); +} + static const AVOption options[] = { TLS_COMMON_OPTIONS(TLSContext, tls_shared), \ {"key_password", "Password for the private key file", OFFSET(priv_key_pw), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ @@ -345,6 +352,7 @@ const URLProtocol ff_tls_protocol = { .url_write = tls_write, .url_close = tls_close, .url_get_file_handle = tls_get_file_handle, + .url_get_short_seek = tls_get_short_seek, .priv_data_size = sizeof(TLSContext), .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class = &tls_class,