aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorSlavik Gnatenko <miracle9@newmail.ru>2003-01-11 20:34:38 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-01-11 20:34:38 +0000
commitf3ec2d46bae60984cb9d0a26e94a2cc298b4f06d (patch)
tree3f59e4e94680c16859794b5ead5ce03eb51d0c31 /libavformat
parent143cc725273c130220e42b7281318ae80083cda3 (diff)
downloadffmpeg-f3ec2d46bae60984cb9d0a26e94a2cc298b4f06d.tar.gz
os2 support patch by ("Slavik Gnatenko" <miracle9 at newmail dot ru>)
Originally committed as revision 1447 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/Makefile6
-rw-r--r--libavformat/file.c2
-rw-r--r--libavformat/img.c6
-rw-r--r--libavformat/utils.c16
4 files changed, 20 insertions, 10 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile
index d688d7060d..9ff067c531 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -48,14 +48,16 @@ ifeq ($(CONFIG_VORBIS),yes)
OBJS+= ogg.o
endif
-LIB= libavformat.a
+LIB= $(LIBPREF)avformat$(LIBSUF)
all: $(LIB)
$(LIB): $(OBJS)
rm -f $@
$(AR) rc $@ $(OBJS)
+ifneq ($(CONFIG_OS2),yes)
$(RANLIB) $@
+endif
installlib: all
install -m 644 $(LIB) $(prefix)/lib
@@ -73,4 +75,4 @@ installlib: all
g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
clean:
- rm -f *.o *~ *.a
+ rm -f *.o *~ *.a $(LIB)
diff --git a/libavformat/file.c b/libavformat/file.c
index 7390962864..a84823a378 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -42,7 +42,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
} else {
access = O_RDONLY;
}
-#ifdef CONFIG_WIN32
+#if defined(CONFIG_WIN32) || defined(CONFIG_OS2)
access |= O_BINARY;
#endif
fd = open(filename, access, 0666);
diff --git a/libavformat/img.c b/libavformat/img.c
index 139e0f48af..f5c45f2c63 100644
--- a/libavformat/img.c
+++ b/libavformat/img.c
@@ -26,9 +26,13 @@
#ifdef __BEOS__
# ifndef usleep
# include <OS.h>
-# define usleep(t) snooze((bigtime_t)(t))
+# define usleep(t) snooze((bigtime_t)(t))
# endif
#endif
+#if defined(CONFIG_OS2)
+# include <stdlib.h>
+# define usleep(t) _sleep2((t) / 1000)
+#endif
typedef struct {
int width;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 0db740333a..f811b2c628 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -18,14 +18,18 @@
*/
#include "avformat.h"
#include <ctype.h>
-#ifndef CONFIG_WIN32
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#else
+#ifdef CONFIG_WIN32
#define strcasecmp _stricmp
#include <sys/types.h>
#include <sys/timeb.h>
+#elif defined(CONFIG_OS2)
+#include <string.h>
+#define strcasecmp stricmp
+#include <sys/time.h>
+#else
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/time.h>
#endif
#include <time.h>
@@ -362,7 +366,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
}
/* XXX: suppress this hack for redirectors */
-#ifndef __MINGW32__
+#ifdef CONFIG_NETWORK
if (fmt == &redir_demux) {
err = redir_open(ic_ptr, &ic->pb);
url_fclose(&ic->pb);