summaryrefslogtreecommitdiff
path: root/libavformat/applehttpproto.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/applehttpproto.c')
-rw-r--r--libavformat/applehttpproto.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c
index 8dbcf2d394..245422be40 100644
--- a/libavformat/applehttpproto.c
+++ b/libavformat/applehttpproto.c
@@ -181,23 +181,18 @@ static int applehttp_close(URLContext *h)
free_segment_list(s);
free_variant_list(s);
ffurl_close(s->seg_hd);
- av_free(s);
return 0;
}
static int applehttp_open(URLContext *h, const char *uri, int flags)
{
- AppleHTTPContext *s;
+ AppleHTTPContext *s = h->priv_data;
int ret, i;
const char *nested_url;
if (flags & AVIO_FLAG_WRITE)
return AVERROR(ENOSYS);
- s = av_mallocz(sizeof(AppleHTTPContext));
- if (!s)
- return AVERROR(ENOMEM);
- h->priv_data = s;
h->is_streamed = 1;
if (av_strstart(uri, "applehttp+", &nested_url)) {
@@ -304,4 +299,5 @@ URLProtocol ff_applehttp_protocol = {
.url_read = applehttp_read,
.url_close = applehttp_close,
.flags = URL_PROTOCOL_FLAG_NESTED_SCHEME,
+ .priv_data_size = sizeof(AppleHTTPContext),
};