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.
This commit is contained in:
Diogo Franco (Kovensky) 2013-07-21 16:54:58 -03:00 committed by wm4
parent 58338f9240
commit db9102765a
2 changed files with 8 additions and 3 deletions

View File

@ -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)

View File

@ -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;