diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-05-21 21:13:22 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-07-15 22:04:46 +0400 |
commit | c3bec4cd1391c7f2ca0e98713e3721d0336b49c4 (patch) | |
tree | af89710132929fb3a30463c5317e0471ef9de859 /libavformat/aviobuf.c | |
parent | e3bc07f4af25287fa4ade1e9c5501de65c8a698e (diff) |
avio: don't replicate avio_alloc_context functionality.
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index fa63ddf2b9..b5e9d4c61c 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -838,19 +838,12 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) if (!buffer) return AVERROR(ENOMEM); - *s = av_mallocz(sizeof(AVIOContext)); - if(!*s) { + *s = avio_alloc_context(buffer, buffer_size, h->flags & AVIO_FLAG_WRITE, h, + ffurl_read, ffurl_write, ffurl_seek); + if (!*s) { av_free(buffer); return AVERROR(ENOMEM); } - - if (ffio_init_context(*s, buffer, buffer_size, - h->flags & AVIO_FLAG_WRITE, h, - ffurl_read, ffurl_write, ffurl_seek) < 0) { - av_free(buffer); - av_freep(s); - return AVERROR(EIO); - } #if FF_API_OLD_AVIO (*s)->is_streamed = h->is_streamed; #endif |