Browse Source

avio: don't replicate avio_alloc_context functionality.

tags/n0.9
Anton Khirnov 14 years ago
parent
commit
c3bec4cd13
1 changed files with 3 additions and 10 deletions
  1. +3
    -10
      libavformat/aviobuf.c

+ 3
- 10
libavformat/aviobuf.c View File

@@ -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


Loading…
Cancel
Save