summaryrefslogtreecommitdiff
path: root/libavformat/avio.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-14 03:21:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-14 03:21:38 +0200
commitc55780dcef1ba87564d8003cded7d045dce9ba34 (patch)
treef685b7150db1c7e0f5e65fb2761f3f8bd843f056 /libavformat/avio.c
parentff5278d8f6203a9486c0cd63a3aecef4bc2e4f6f (diff)
parent651b276ef7ad8d89e89bfc94a4232ab6c36f3a8a (diff)
Merge remote branch 'qatar/master'
* qatar/master: (32 commits) libopencore-amr, libvo-amrwbenc: Allow enabling DTX via private AVOptions libopencore-amr, libvo-amrwbenc: Only check the bitrate when changed libopencore-amr, libvo-amrwbenc: Find the closest matching bitrate libvo-*: Fix up the long codec names libavcodec: Mark AVCodec->priv_class const swscale: Factorize FAST_BGR2YV12 definition. libvo-aacenc: Only produce extradata if the global header flag is set lavf: postpone removal of public metadata conversion API lavc: postpone removal of request_channels lavc: postpone removal of audioconvert and sample_fmt wrappers lavf: postpone removal of deprecated avio functions libopencore-amr: Cosmetics: Rewrap and align libopencore-amr, libvo-amrbwenc: Rename variables and functions libopencore-amr: Convert commented out debug logging into av_dlog libopencore-amr: Remove an unused state variable libvo-amrwbenc: Don't explicitly store bitrate modes in the bitrate table libopencore-amr: Remove a useless local variable libopencore-amr, libvo-amrwbenc: Make the bitrate/mode mapping array static const libopencore-amr, libvo-amrwbenc: Return proper error codes in most places libopencore-amr: Don't print carriage returns in log messages ... Conflicts: doc/developer.texi libavcodec/avcodec.h libavcodec/libvo-aacenc.c libavcodec/libvo-amrwbenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r--libavformat/avio.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 934fa213e9..725a95f768 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -363,6 +363,7 @@ int ffurl_close(URLContext *h)
return ret;
}
+#if FF_API_OLD_AVIO
int url_exist(const char *filename)
{
URLContext *h;
@@ -371,6 +372,26 @@ int url_exist(const char *filename)
ffurl_close(h);
return 1;
}
+#endif
+
+int avio_check(const char *url, int flags)
+{
+ URLContext *h;
+ int ret = ffurl_alloc(&h, url, flags);
+ if (ret)
+ return ret;
+
+ if (h->prot->url_check) {
+ ret = h->prot->url_check(h, flags);
+ } else {
+ ret = ffurl_connect(h);
+ if (ret >= 0)
+ ret = flags;
+ }
+
+ ffurl_close(h);
+ return ret;
+}
int64_t ffurl_size(URLContext *h)
{