diff mbox series

[FFmpeg-devel,2/3] tls: Hook up the url_get_short_seek function in the TLS backends

Message ID 20201030110122.26502-2-martin@martin.st
State Accepted
Headers show
Series [FFmpeg-devel,1/3] tls: Share code for common protocol functions and fields | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Martin Storsjö Oct. 30, 2020, 11:01 a.m. UTC
This makes sure that small seeks forward on https don't end up
doing new requests.
---
 libavformat/tls.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/tls.h b/libavformat/tls.h
index 4f3315427d..d33af80454 100644
--- a/libavformat/tls.h
+++ b/libavformat/tls.h
@@ -56,10 +56,17 @@  static int tls_get_file_handle(URLContext *h)                                 \
 {                                                                             \
     TLSContext *c = h->priv_data;                                             \
     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);                           \
 }
 
+
 #define TLS_COMMON_PROTOCOL_FIELDS                                            \
     .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