summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
authorJeyapal, Karthick <kjeyapal@akamai.com>2017-11-29 14:31:34 +0800
committerSteven Liu <lq@chinaffmpeg.org>2017-11-29 14:31:34 +0800
commit62f63b24bfec22134bc5b9312bc6afe824e63199 (patch)
treebec96a17cc2c08eb756747481dfae8fa279415bb /libavformat/aviobuf.c
parentc5fd57f483d2ad8e34551b78509f1e14136f73c0 (diff)
downloadffmpeg-62f63b24bfec22134bc5b9312bc6afe824e63199.tar.gz
libavformat/avio: Utility function to return URLContext
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 3b4c8439d6..86eb6579f4 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -980,6 +980,19 @@ fail:
return AVERROR(ENOMEM);
}
+URLContext* ffio_geturlcontext(AVIOContext *s)
+{
+ AVIOInternal *internal;
+ if (!s)
+ return NULL;
+
+ internal = s->opaque;
+ if (internal && s->read_packet == io_read_packet)
+ return internal->h;
+ else
+ return NULL;
+}
+
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
{
uint8_t *buffer;