summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/input/input_cdda.c20
-rw-r--r--src/input/input_http.c13
-rw-r--r--src/input/input_net.c18
-rwxr-xr-xwin32/include/sys/socket.h9
-rw-r--r--win32/libxine.def1
-rw-r--r--win32/xine.dsw44
-rwxr-xr-xwin32/xineplug_inp_http.dsp114
-rwxr-xr-xwin32/xineplug_inp_net.dsp114
8 files changed, 315 insertions, 18 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 113d8d130..0948ed035 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -20,7 +20,7 @@
* Compact Disc Digital Audio (CDDA) Input Plugin
* by Mike Melanson (melanson@pcisys.net)
*
- * $Id: input_cdda.c,v 1.24 2003/05/20 02:06:13 tmmm Exp $
+ * $Id: input_cdda.c,v 1.25 2003/05/20 16:23:44 tchamp Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -684,7 +684,6 @@ static int read_cdrom_toc(cdda_input_plugin_t *this_gen, cdrom_toc *toc) {
else
{
DWORD dwBytesReturned;
- DWORD dw;
CDROM_TOC cdrom_toc;
int i;
@@ -694,10 +693,10 @@ static int read_cdrom_toc(cdda_input_plugin_t *this_gen, cdrom_toc *toc) {
&dwBytesReturned, NULL ) == 0 )
{
#ifdef LOG
- printf( "xineplug_inp_cdda : could not read TOCHDR\n" );
- dw = GetLastError();
- printf("GetLastError returned %u\n", dw);
-
+ DWORD dw;
+ printf( "xineplug_inp_cdda : could not read TOCHDR\n" );
+ dw = GetLastError();
+ printf("GetLastError returned %u\n", dw);
#endif
return -1;
}
@@ -749,7 +748,6 @@ static int read_cdrom_toc(cdda_input_plugin_t *this_gen, cdrom_toc *toc) {
static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_frames,
unsigned char *data) {
- DWORD dw;
DWORD dwBytesReturned;
RAW_READ_INFO raw_read_info;
@@ -783,6 +781,7 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f
&dwBytesReturned, NULL ) == 0 )
{
#ifdef LOG
+ DWORD dw;
printf( "xineplug_inp_cdda : could not read frame\n" );
dw = GetLastError();
printf("GetLastError returned %u\n", dw);
@@ -838,7 +837,12 @@ static int host_connect_attempt (struct in_addr ia, int port)
sin.sin_addr = ia;
sin.sin_port = htons(port);
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS) {
+#ifndef WIN32
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS)
+#else
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && WSAGetLastError != WSAEINPROGRESS)
+#endif /* WIN32 */
+ {
printf("input_cdda: cannot connect to host\n");
close(s);
return -1;
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 09b058a43..d05ae687d 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -31,9 +31,13 @@
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
+
+#ifndef WIN32
#include <arpa/inet.h>
#include <netdb.h>
#include <errno.h>
+#endif /* WIN32 */
+
#include <sys/time.h>
#include "xine_internal.h"
@@ -123,8 +127,13 @@ static int http_plugin_host_connect_attempt (struct in_addr ia, int port,
sin.sin_family = AF_INET;
sin.sin_addr = ia;
sin.sin_port = htons(port);
-
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS) {
+
+#ifndef WIN32
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS)
+#else
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && WSAGetLastError != WSAEINPROGRESS)
+#endif /* WIN32 */
+ {
xine_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "cannot connect to host", NULL);
xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: cannot connect to host\n"));
close(s);
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 48bba37e6..1e180d94c 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -20,7 +20,7 @@
* Read from a tcp network stream over a lan (put a tweaked mp1e encoder the
* other end and you can watch tv anywhere in the house ..)
*
- * $Id: input_net.c,v 1.47 2003/05/15 20:23:17 miguelfreitas Exp $
+ * $Id: input_net.c,v 1.48 2003/05/20 16:23:44 tchamp Exp $
*
* how to set up mp1e for use with this plugin:
*
@@ -48,8 +48,12 @@
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
+
+#ifndef WIN32
#include <arpa/inet.h>
#include <netdb.h>
+#endif
+
#include <errno.h>
#include <sys/time.h>
@@ -63,6 +67,11 @@
xine_log(xine, XINE_LOG_MSG, message, ##args); \
printf(message, ##args); \
}
+#elif defined (WIN32)
+#define LOG_MSG(xine, message, args) { \
+ xine_log(xine, XINE_LOG_MSG, message, #args); \
+ printf(message, #args); \
+ }
#else
#define LOG_MSG(xine, ...) { \
xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \
@@ -127,7 +136,12 @@ static int host_connect_attempt(struct in_addr ia, int port, xine_t *xine) {
sin.sin_addr = ia;
sin.sin_port = htons(port);
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS) {
+#ifndef WIN32
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS)
+#else
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && WSAGetLastError != WSAEINPROGRESS)
+#endif
+ {
LOG_MSG (xine, _("input_net: connect(): %s\n"), strerror(errno));
close(s);
return -1;
diff --git a/win32/include/sys/socket.h b/win32/include/sys/socket.h
index 6552cb5ee..be5d9a614 100755
--- a/win32/include/sys/socket.h
+++ b/win32/include/sys/socket.h
@@ -20,6 +20,9 @@
* WIN32 PORT,
*/
+#ifndef _SOCKET_H
+#define _SOCKET_H
+
#include <fcntl.h> /* Not sure that this is needed */
#include <io.h> /* open, close, ... */
@@ -31,8 +34,4 @@
#define SIGALRM 14
#endif
-/* Some real good hacks! */
-#undef errno
-#define errno WSAGetLastError
-
-#define EINPROGRESS WSAEINPROGRESS
+#endif /* _SOCKET_H */ \ No newline at end of file
diff --git a/win32/libxine.def b/win32/libxine.def
index 6173e36fd..fc8b0d036 100644
--- a/win32/libxine.def
+++ b/win32/libxine.def
@@ -72,6 +72,7 @@ xine_demux_control_start
xine_demux_flush_engine
xine_demux_check_extension
xine_demux_read_header
+xine_read_abort
fourcc_to_buf_video
formattag_to_buf_audio
diff --git a/win32/xine.dsw b/win32/xine.dsw
index fd08b912b..cab86db98 100644
--- a/win32/xine.dsw
+++ b/win32/xine.dsw
@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
-Project: "libdvdcss"="..\src\src\src\demuxers\contrib\dirent\contrib\dirent\libdvdcss.dsp" - Package Owner=<4>
+Project: "libdvdcss"="..\src\src\src\src\src\demuxers\contrib\dirent\contrib\dirent\libdvdcss.dsp" - Package Owner=<4>
Package=<5>
{{{
@@ -471,6 +471,48 @@ Package=<4>
###############################################################################
+Project: "xineplug_inp_http"=".\xineplug_inp_http.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libxine
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libxinesuppt
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libxineutils
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "xineplug_inp_net"=".\xineplug_inp_net.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libxine
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libxinesuppt
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libxineutils
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "xineplug_vo_out_directx"=".\xineplug_vo_out_directx.dsp" - Package Owner=<4>
Package=<5>
diff --git a/win32/xineplug_inp_http.dsp b/win32/xineplug_inp_http.dsp
new file mode 100755
index 000000000..9a5df4344
--- /dev/null
+++ b/win32/xineplug_inp_http.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="xineplug_inp_http" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=xineplug_inp_http - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "xineplug_inp_http.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "xineplug_inp_http.mak" CFG="xineplug_inp_http - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "xineplug_inp_http - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "xineplug_inp_http - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "xineplug_inp_http - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release/xineplug_inp_http"
+# PROP Intermediate_Dir "Release/xineplug_inp_http"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LIB32=link.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_HTTP_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "../src" /I "../src/xine-engine" /I "../src/xine-utils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_HTTP_EXPORTS" /D "XINE_COMPILE" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 /nologo /dll /machine:I386 /out:"Release/bin/plugins/xineplug_inp_http.so"
+
+!ELSEIF "$(CFG)" == "xineplug_inp_http - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug/xineplug_inp_http"
+# PROP Intermediate_Dir "Debug/xineplug_inp_http"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LIB32=link.exe
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_HTTP_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /I "include" /I "contrib/pthreads" /I "contrib/timer" /I "contrib/dirent" /I "../include" /I "../src" /I "../src/xine-engine" /I "../src/xine-utils" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_HTTP_EXPORTS" /D "XINE_COMPILE" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug/bin/plugins/xineplug_inp_http.so" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "xineplug_inp_http - Win32 Release"
+# Name "xineplug_inp_http - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\input\input_http.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\input\net_buf_ctrl.c
+# End Source File
+# End Group
+# Begin Group "DLL Defs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\xineplug_inp.def
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/win32/xineplug_inp_net.dsp b/win32/xineplug_inp_net.dsp
new file mode 100755
index 000000000..3de209340
--- /dev/null
+++ b/win32/xineplug_inp_net.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="xineplug_inp_net" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=xineplug_inp_net - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "xineplug_inp_net.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "xineplug_inp_net.mak" CFG="xineplug_inp_net - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "xineplug_inp_net - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "xineplug_inp_net - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "xineplug_inp_net - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release/xineplug_inp_net"
+# PROP Intermediate_Dir "Release/xineplug_inp_net"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LIB32=link.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_NET_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "../src" /I "../src/xine-engine" /I "../src/xine-utils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_NET_EXPORTS" /D "XINE_COMPILE" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 /nologo /dll /machine:I386 /out:"Release/bin/plugins/xineplug_inp_net.so"
+
+!ELSEIF "$(CFG)" == "xineplug_inp_net - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug/xineplug_inp_net"
+# PROP Intermediate_Dir "Debug/xineplug_inp_net"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LIB32=link.exe
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_NET_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /I "include" /I "contrib/pthreads" /I "contrib/timer" /I "contrib/dirent" /I "../include" /I "../src" /I "../src/xine-engine" /I "../src/xine-utils" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_INP_NET_EXPORTS" /D "XINE_COMPILE" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug/bin/plugins/xineplug_inp_net.so" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "xineplug_inp_net - Win32 Release"
+# Name "xineplug_inp_net - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\input\input_net.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\input\net_buf_ctrl.c
+# End Source File
+# End Group
+# Begin Group "DLL Defs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\xineplug_inp.def
+# End Source File
+# End Group
+# End Target
+# End Project