]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/cache.c
h263dec: restore error concealment functionality after merge
[ffmpeg] / libavformat / cache.c
index c2bddf5f6d5a826784788a6c9358d68e7e87519a..d94cf5fbaca071262d0bf02a0b181e14b38404e1 100644 (file)
@@ -53,13 +53,7 @@ static int cache_open(URLContext *h, const char *arg, int flags)
 {
     int access;
     const char *buffername;
-    Context *c;
-
-    c = av_mallocz(sizeof(Context));
-    if (!c) {
-        return AVERROR(ENOMEM);
-    }
-    h->priv_data = c;
+    Context *c= h->priv_data;
 
     av_strstart(arg, "cache:", &arg);
 
@@ -130,8 +124,6 @@ static int cache_close(URLContext *h)
     close(c->fd);
     ffurl_close(c->inner);
 
-    av_freep(&h->priv_data);
-
     return 0;
 }
 
@@ -141,4 +133,5 @@ URLProtocol ff_cache_protocol = {
     .url_read            = cache_read,
     .url_seek            = cache_seek,
     .url_close           = cache_close,
+    .priv_data_size      = sizeof(Context),
 };