[FFmpeg-cvslog] r15594 - in trunk: configure libavformat/avio.c libavformat/os_support.h

ramiro subversion
Fri Oct 10 18:59:37 CEST 2008


Author: ramiro
Date: Fri Oct 10 18:59:37 2008
New Revision: 15594

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

Modified:
   trunk/configure
   trunk/libavformat/avio.c
   trunk/libavformat/os_support.h

Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Fri Oct 10 18:59:37 2008
@@ -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

Modified: trunk/libavformat/avio.c
==============================================================================
--- trunk/libavformat/avio.c	(original)
+++ trunk/libavformat/avio.c	Fri Oct 10 18:59:37 2008
@@ -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 cha
         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 {

Modified: trunk/libavformat/os_support.h
==============================================================================
--- trunk/libavformat/os_support.h	(original)
+++ trunk/libavformat/os_support.h	Fri Oct 10 18:59:37 2008
@@ -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>




More information about the ffmpeg-cvslog mailing list