From db9102765afe9f8904ff299632dc09a5035a3eb8 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Sun, 21 Jul 2013 16:54:58 -0300 Subject: stream_vcd.c: fix compilation on win32 The mp_vcd_priv_t struct doesn't have a file descriptor but a file handle on win32. --- stream/stream_vcd.c | 9 ++++++--- stream/vcd_read_win32.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'stream') diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c index 0fd2998c58..229d78bfc2 100644 --- a/stream/stream_vcd.c +++ b/stream/stream_vcd.c @@ -53,6 +53,10 @@ #include "vcd_read.h" #endif +#ifndef vcd_close +#define vcd_close(priv) (close(((mp_vcd_priv_t*)priv)->fd)) +#endif + extern char *cdrom_device; static struct stream_priv_s { @@ -95,9 +99,8 @@ static int seek(stream_t *s,int64_t newpos) { } static void close_s(stream_t *stream) { - mp_vcd_priv_t *p = stream->priv; - close(p->fd); - free(p); + vcd_close(stream->priv); + free(stream->priv); } static int open_s(stream_t *stream,int mode, void* opts) diff --git a/stream/vcd_read_win32.h b/stream/vcd_read_win32.h index f70e2b5ed3..cf587316af 100644 --- a/stream/vcd_read_win32.h +++ b/stream/vcd_read_win32.h @@ -132,6 +132,8 @@ static mp_vcd_priv_t* vcd_read_toc(int fd) return vcd; } +#define vcd_close(priv) (CloseHandle(((mp_vcd_priv_t*)priv)->hd)) + static int vcd_read(mp_vcd_priv_t* vcd, char *mem) { DWORD dwBytesReturned; -- cgit v1.2.3