Author: compn Date: Mon Mar 12 16:48:13 2007 New Revision: 22524 Modified: trunk/stream/stream_vcd.c Log: add vcd:// for win32, patch by zuxy meng Modified: trunk/stream/stream_vcd.c ============================================================================== --- trunk/stream/stream_vcd.c (original) +++ trunk/stream/stream_vcd.c Mon Mar 12 16:48:13 2007 @@ -1,6 +1,10 @@ #include "config.h" +#ifdef WIN32 +#include <windows.h> +#endif + #include "mp_msg.h" #include "stream.h" #include "help_mp.h" @@ -10,7 +14,9 @@ #include <fcntl.h> #include <stdlib.h> #include <unistd.h> +#ifndef WIN32 #include <sys/ioctl.h> +#endif #include <errno.h> #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) @@ -20,6 +26,8 @@ #include "vcd_read_nbsd.h" #elif defined(SYS_DARWIN) #include "vcd_read_darwin.h" +#elif defined(WIN32) +#include "vcd_read_win32.h" #else #include "vcd_read.h" #endif @@ -76,8 +84,16 @@ static int open_s(stream_t *stream,int m #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int bsize = VCD_SECTOR_SIZE; #endif +#ifdef WIN32 + HANDLE hd; + char device[] = "\\\\.\\?:"; +#endif - if(mode != STREAM_READ) { + if(mode != STREAM_READ +#ifdef WIN32 + || GetVersion() > 0x80000000 // Win9x +#endif + ) { m_struct_free(&stream_opts,opts); return STREAM_UNSUPORTED; } @@ -89,7 +105,15 @@ static int open_s(stream_t *stream,int m p->device = strdup(DEFAULT_CDROM_DEVICE); } +#ifdef WIN32 + device[4] = p->device[0]; + /* open() can't be used for devices so do it the complicated way */ + hd = CreateFile(device, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL); + f = _open_osfhandle((long)hd, _O_RDONLY); +#else f=open(p->device,O_RDONLY); +#endif if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,p->device); m_struct_free(&stream_opts,opts);
compn wrote:
Author: compn Date: Mon Mar 12 16:48:13 2007 New Revision: 22524
Modified: trunk/stream/stream_vcd.c
Log: add vcd:// for win32, patch by zuxy meng
I would have preferred if you had committed the changes to configure and stream_vcd.c in a single operation: they are strictly related -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Questo inverno scaldale il cuore, con il prezioso calore di un Diamante. * Non lasciarti sfuggire lo sconto del 20% riservato a te! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=5630&d=12-3
On Mon, 12 Mar 2007 16:53:22 +0100, Nico Sabbi scribed:
compn wrote:
Author: compn Date: Mon Mar 12 16:48:13 2007 New Revision: 22524
Modified: trunk/stream/stream_vcd.c
Log: add vcd:// for win32, patch by zuxy meng
I would have preferred if you had committed the changes to configure and stream_vcd.c in a single operation: they are strictly related
oops, will do next time. unless you want me to recommit? -compn
Hello, On Mon, Mar 12, 2007 at 11:04:13AM -0500, Compn wrote:
On Mon, 12 Mar 2007 16:53:22 +0100, Nico Sabbi scribed:
compn wrote:
Author: compn Date: Mon Mar 12 16:48:13 2007 New Revision: 22524
Modified: trunk/stream/stream_vcd.c
Log: add vcd:// for win32, patch by zuxy meng
I would have preferred if you had committed the changes to configure and stream_vcd.c in a single operation: they are strictly related
oops, will do next time. unless you want me to recommit?
No, that won't do any good. Maybe you could change the commit messages to reference the other revision numbers of parts of the patch? (something like "remaining parts of this patch in r.... and r....") That should make future confusion unlikely. Greetings, Reimar Döffinger
On Mon, 12 Mar 2007 20:35:47 +0100, Reimar Döffinger scribed:
Hello, On Mon, Mar 12, 2007 at 11:04:13AM -0500, Compn wrote:
On Mon, 12 Mar 2007 16:53:22 +0100, Nico Sabbi scribed:
compn wrote:
Author: compn Date: Mon Mar 12 16:48:13 2007 New Revision: 22524
Modified: trunk/stream/stream_vcd.c
Log: add vcd:// for win32, patch by zuxy meng
I would have preferred if you had committed the changes to configure and stream_vcd.c in a single operation: they are strictly related
oops, will do next time. unless you want me to recommit?
No, that won't do any good. Maybe you could change the commit messages to reference the other revision numbers of parts of the patch? (something like "remaining parts of this patch in r.... and r....") That should make future confusion unlikely.
done, hopefully its not confusing now. -compn
participants (4)
-
compn -
Compn -
Nico Sabbi -
Reimar Döffinger