diff options
author | Jordi Ortiz <nenjordi@gmail.com> | 2012-08-17 18:38:59 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-08-17 22:14:30 +0300 |
commit | d6b9da1178a8e84d1bf999337c058440826d3f54 (patch) | |
tree | 29e00dd205c3c4c2c5670a1e639742ca04706c91 /libavformat/avio.c | |
parent | 2e8f3cbcda536970aee03f5543185d7fc01232a1 (diff) | |
download | ffmpeg-d6b9da1178a8e84d1bf999337c058440826d3f54.tar.gz |
avio: add (ff)url_get_multi_file_handle() for getting more than one fd
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r-- | libavformat/avio.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 5acaf30e90..45ee86688f 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -344,6 +344,21 @@ int ffurl_get_file_handle(URLContext *h) return h->prot->url_get_file_handle(h); } +int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles) +{ + if (!h->prot->url_get_multi_file_handle) { + if (!h->prot->url_get_file_handle) + return AVERROR(ENOSYS); + *handles = av_malloc(sizeof(*handles)); + if (!*handles) + return AVERROR(ENOMEM); + *numhandles = 1; + *handles[0] = h->prot->url_get_file_handle(h); + return 0; + } + return h->prot->url_get_multi_file_handle(h, handles, numhandles); +} + int ffurl_shutdown(URLContext *h, int flags) { if (!h->prot->url_shutdown) |