summaryrefslogtreecommitdiffstats
path: root/stream/stream_vcd.c
diff options
context:
space:
mode:
authorkomh <komh@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-03 14:32:29 +0000
committerkomh <komh@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-03 14:32:29 +0000
commit9beeeb1a9ecec3916f16e8315edc026b7f48ac21 (patch)
treed0fa76e49a67b981d83dd87a58a0b56b677c7b06 /stream/stream_vcd.c
parentc106fe7751426c8c30706d2f131491dc8f37ee85 (diff)
downloadmpv-9beeeb1a9ecec3916f16e8315edc026b7f48ac21.tar.bz2
mpv-9beeeb1a9ecec3916f16e8315edc026b7f48ac21.tar.xz
Add a VCD support for OS/2
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30819 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream_vcd.c')
-rw-r--r--stream/stream_vcd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c
index 9ed8ac7a58..819c3e52ea 100644
--- a/stream/stream_vcd.c
+++ b/stream/stream_vcd.c
@@ -22,6 +22,8 @@
#include <windows.h>
#endif
+#include "osdep/osdep.h"
+
#include "mp_msg.h"
#include "stream.h"
#include "help_mp.h"
@@ -42,6 +44,8 @@
#include "vcd_read_darwin.h"
#elif defined(__MINGW32__) || defined(__CYGWIN__)
#include "vcd_read_win32.h"
+#elif defined(__OS2__)
+#include "vcd_read_os2.h"
#else
#include "vcd_read.h"
#endif
@@ -102,6 +106,12 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
HANDLE hd;
char device[] = "\\\\.\\?:";
#endif
+#if defined(__OS2__)
+ char device[] = "X:";
+ HFILE hcd;
+ ULONG ulAction;
+ ULONG rc;
+#endif
if(mode != STREAM_READ
#if defined(__MINGW32__) || defined(__CYGWIN__)
@@ -125,6 +135,13 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
hd = CreateFile(device, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
f = _open_osfhandle((long)hd, _O_RDONLY);
+#elif defined(__OS2__)
+ device[0] = p->device[0];
+ rc = DosOpen(device, &hcd, &ulAction, 0, FILE_NORMAL,
+ OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
+ OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
+ NULL);
+ f = rc ? -1 : hcd;
#else
f=open(p->device,O_RDONLY);
#endif