Commit bc574408 authored by Ramiro Polla's avatar Ramiro Polla

Only special-case absolute DOS paths on systems that support them.

Originally committed as revision 15594 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 60e8bc13
...@@ -754,6 +754,7 @@ HAVE_LIST=" ...@@ -754,6 +754,7 @@ HAVE_LIST="
dev_video_bktr_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h
dlfcn_h dlfcn_h
dlopen dlopen
dos_paths
ebp_available ebp_available
ebx_available ebx_available
fast_64bit fast_64bit
...@@ -1295,6 +1296,7 @@ case $target_os in ...@@ -1295,6 +1296,7 @@ case $target_os in
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"' 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' SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
objformat="win32" objformat="win32"
enable dos_paths
;; ;;
cygwin*) cygwin*)
target_os=cygwin target_os=cygwin
...@@ -1312,6 +1314,7 @@ case $target_os in ...@@ -1312,6 +1314,7 @@ case $target_os in
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SHFLAGS='-shared -Wl,--enable-auto-image-base' SHFLAGS='-shared -Wl,--enable-auto-image-base'
objformat="win32" objformat="win32"
enable dos_paths
;; ;;
*-dos|freedos|opendos) *-dos|freedos|opendos)
disable ffplay ffserver vhook disable ffplay ffserver vhook
...@@ -1319,6 +1322,7 @@ case $target_os in ...@@ -1319,6 +1322,7 @@ case $target_os in
network_extralibs="-lsocket" network_extralibs="-lsocket"
EXESUF=".exe" EXESUF=".exe"
objformat="win32" objformat="win32"
enable dos_paths
;; ;;
linux) linux)
enable dv1394 enable dv1394
...@@ -1350,6 +1354,7 @@ case $target_os in ...@@ -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_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' SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
disable vhook disable vhook
enable dos_paths
;; ;;
interix) interix)
disable vhook disable vhook
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavcodec/opt.h" #include "libavcodec/opt.h"
#include "os_support.h"
#include "avformat.h" #include "avformat.h"
#if LIBAVFORMAT_VERSION_MAJOR >= 53 #if LIBAVFORMAT_VERSION_MAJOR >= 53
...@@ -115,7 +116,7 @@ int url_open(URLContext **puc, const char *filename, int flags) ...@@ -115,7 +116,7 @@ int url_open(URLContext **puc, const char *filename, int flags)
p++; p++;
} }
/* if the protocol has length 1, we consider it is a dos drive */ /* 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: file_proto:
strcpy(proto_str, "file"); strcpy(proto_str, "file");
} else { } else {
......
...@@ -32,6 +32,15 @@ ...@@ -32,6 +32,15 @@
# define lseek(f,p,w) _lseeki64((f), (p), (w)) # define lseek(f,p,w) _lseeki64((f), (p), (w))
#endif #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__ #ifdef __BEOS__
# include <sys/socket.h> # include <sys/socket.h>
# include <netinet/in.h> # include <netinet/in.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment