summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-05-08 14:38:35 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-05-08 14:38:35 +0000
commit1f48888099322bdec68f7bd10c3c370a42f48744 (patch)
treec79adafdb9bfc74628a37b9275c989257146c624 /TOOLS
parent873194cb417b1696f92d648c575e512649f3ad27 (diff)
downloadmpv-1f48888099322bdec68f7bd10c3c370a42f48744.tar.bz2
mpv-1f48888099322bdec68f7bd10c3c370a42f48744.tar.xz
MinGW compilation fix by Erik Lunchpail <erik_27can at yahoo dot com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15368 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/netstream/Makefile12
-rw-r--r--TOOLS/netstream/netstream.c25
2 files changed, 33 insertions, 4 deletions
diff --git a/TOOLS/netstream/Makefile b/TOOLS/netstream/Makefile
index fb33908567..bafad47fe6 100644
--- a/TOOLS/netstream/Makefile
+++ b/TOOLS/netstream/Makefile
@@ -16,11 +16,9 @@ all: netstream
$(CC) -c $(CFLAGS) -o $@ $<
-netstream: $(MPROOT)/libmpdemux/libmpdemux.a netstream.o
# FIXME: linking is a mess that should be fixed properly some day
# it does not work with either GUI, live.com or libavformat enabled
- $(CC) $(CFLAGS) netstream.o -o netstream \
- $(MPROOT)/libmpdemux/libmpdemux.a \
+DEPS = $(MPROOT)/libmpdemux/libmpdemux.a \
$(MPROOT)/libmpdvdkit2/libmpdvdkit.a \
$(MPROOT)/libmpcodecs/native/minilzo.o \
$(MPROOT)/libvo/aclib.o $(MPROOT)/libmpcodecs/img_format.o \
@@ -31,6 +29,14 @@ netstream: $(MPROOT)/libmpdemux/libmpdemux.a netstream.o
$(VORBIS_LIB) $(CDPARANOIA_LIB) $(Z_LIB) $(GIF_LIB) \
$(SMBSUPPORT_LIB) $(LIVE_LIBS) $(ARCH_LIB) $(COMMON_LIBS) -lm
+ifeq ($(TARGET_WIN32),yes)
+DEPS += $(MPROOT)/osdep/glob-win.o $(WIN32_LIB) -lwsock32
+endif
+
+netstream: $(MPROOT)/libmpdemux/libmpdemux.a netstream.o
+
+ $(CC) $(CFLAGS) netstream.o -o netstream $(DEPS)
+
clean:
rm -f *.o *.a *~
diff --git a/TOOLS/netstream/netstream.c b/TOOLS/netstream/netstream.c
index 9e534f7687..88a65fa194 100644
--- a/TOOLS/netstream/netstream.c
+++ b/TOOLS/netstream/netstream.c
@@ -38,6 +38,7 @@
#include <arpa/inet.h>
#else
#include <winsock2.h>
+#include <ws2tcpip.h>
#endif
#include <libmpdemux/stream.h>
@@ -53,6 +54,16 @@
char* dvdsub_lang=NULL;
char* audio_lang=NULL;
int sub_justify=0;
+int identify=0;
+int dvdsub_id=0;
+int audio_id=0;
+int video_id=0;
+void af_fmt2str() {};
+
+#ifdef __MINGW32__
+#define usleep sleep
+void strsep() {};
+#endif
static unsigned short int port = 10000;
@@ -254,7 +265,11 @@ void exit_sig(int sig) {
count++;
if(count==3) exit(1);
if(count > 3)
+#ifdef __MINGW32__
+ WSACleanup();
+#else
kill(getpid(),SIGKILL);
+#endif
run_server = 0;
}
@@ -263,10 +278,11 @@ static int main_loop(int listen_fd) {
fd_set fds;
signal(SIGTERM,exit_sig); // kill
+#ifndef __MINGW32__
signal(SIGHUP,exit_sig); // kill -HUP / xterm closed
signal(SIGINT,exit_sig); // Interrupt from keyboard
signal(SIGQUIT,exit_sig); // Quit from keyboard
-
+#endif
while(run_server) {
int sel_n = make_fd_set(&fds,&clients,listen_fd);
@@ -309,6 +325,9 @@ static int main_loop(int listen_fd) {
}
mp_msg(MSGT_NETST,MSGL_INFO,"Exit ....\n");
close(listen_fd);
+#ifdef __MINGW32__
+ WSACleanup();
+#endif
while(clients) {
client_t* f = clients;
if(f->stream) free_stream(f->stream);
@@ -326,6 +345,10 @@ int main(int argc, char** argv) {
mp_msg_init();
mp_msg_set_level(verbose+MSGL_STATUS);
+#ifdef __MINGW32__
+ WSADATA wsaData;
+ WSAStartup(MAKEWORD(1,1), &wsaData);
+#endif
listen_fd = socket(AF_INET, SOCK_STREAM, 0);
if(listen_fd < 0) {
mp_msg(MSGT_NETST,MSGL_FATAL,"Failed to create listen_fd: %s\n",strerror(errno));