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="
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
......
......@@ -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 {
......
......@@ -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>
......
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