summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2008-10-10 16:59:37 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2008-10-10 16:59:37 +0000
commitbc574408dc011943b82de012451f95266bed9989 (patch)
tree384b3321b62c07f7631dbc40e5733a088e7a2aa6
parent60e8bc13a9076212499c01b36b6dc0574d534be6 (diff)
Only special-case absolute DOS paths on systems that support them.
Originally committed as revision 15594 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rwxr-xr-xconfigure5
-rw-r--r--libavformat/avio.c3
-rw-r--r--libavformat/os_support.h9
3 files changed, 16 insertions, 1 deletions
diff --git a/configure b/configure
index b0df94c12b..0428454607 100755
--- a/configure
+++ b/configure
@@ -754,6 +754,7 @@ HAVE_LIST="
dev_video_bktr_ioctl_bt848_h
dlfcn_h
dlopen
+ dos_paths
ebp_available
ebx_available
fast_64bit
@@ -1295,6 +1296,7 @@ case $target_os in
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
objformat="win32"
+ enable dos_paths
;;
cygwin*)
target_os=cygwin
@@ -1312,6 +1314,7 @@ case $target_os in
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SHFLAGS='-shared -Wl,--enable-auto-image-base'
objformat="win32"
+ enable dos_paths
;;
*-dos|freedos|opendos)
disable ffplay ffserver vhook
@@ -1319,6 +1322,7 @@ case $target_os in
network_extralibs="-lsocket"
EXESUF=".exe"
objformat="win32"
+ enable dos_paths
;;
linux)
enable dv1394
@@ -1350,6 +1354,7 @@ case $target_os in
SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
disable vhook
+ enable dos_paths
;;
interix)
disable vhook
diff --git a/libavformat/avio.c b/libavformat/avio.c
index c2acb4664e..5809c40479 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -21,6 +21,7 @@
#include "libavutil/avstring.h"
#include "libavcodec/opt.h"
+#include "os_support.h"
#include "avformat.h"
#if LIBAVFORMAT_VERSION_MAJOR >= 53
@@ -115,7 +116,7 @@ int url_open(URLContext **puc, const char *filename, int flags)
p++;
}
/* if the protocol has length 1, we consider it is a dos drive */
- if (*p == '\0' || (q - proto_str) <= 1) {
+ if (*p == '\0' || is_dos_path(filename)) {
file_proto:
strcpy(proto_str, "file");
} else {
diff --git a/libavformat/os_support.h b/libavformat/os_support.h
index e547085dff..2fd3112b7e 100644
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@ -32,6 +32,15 @@
# define lseek(f,p,w) _lseeki64((f), (p), (w))
#endif
+static inline int is_dos_path(const char *path)
+{
+#ifdef HAVE_DOS_PATHS
+ if (path[0] && path[1] == ':')
+ return 1;
+#endif
+ return 0;
+}
+
#ifdef __BEOS__
# include <sys/socket.h>
# include <netinet/in.h>