[MPlayer-dev-eng] [PATCH] VCD support for Windows (except Win9x)

Compn tempn at twmi.rr.com
Fri Mar 2 16:30:56 CET 2007


On Wed, 28 Feb 2007 16:10:15 +0800, 
Zuxy Meng scribed:

> Hi,
> 
> 2007/2/27, Gianluigi Tiesi <mplayer at netfarm.it>:
> > On Mon, Feb 26, 2007 at 03:22:47PM +0100, Reimar D?ffinger wrote:
> > > Hello,
> > > On Mon, Feb 26, 2007 at 09:49:10PM +0800, Zuxy Meng wrote:
> > > > 2007/2/26, Compn <tempn at twmi.rr.com>:
> > > > >On Mon, 26 Feb 2007 21:37:40 +0800,
> > > > >Zuxy Meng scribed:
> > > > >
> > > > >> +#ifdef WIN32
> > > > >> +  HANDLE hd;
> > > > >> +  char device[] = "\\\\.\\D:";
> > > > >> +#endif
> > > > >
> > > > >does this hardcode the device name?
> > > > >D: is not the dvd/cdrom drive on all systems.
> > > >
> > > > D is only a stub here. The actual letter is filled by:
> > > > +  device[4] = p->device[0];
> > >
> > > With any sane combination of compiler and operating system this
> > > should crash. String constants are supposed to be in readonly
> > > memory.
> > >
> >
> > char * are r/w, const char * "should be" r/o (but most compiler
> > still keep it as r/w).
> > msvc6 is able to have a #define MYSTRING "test1", with the string
> > reference r/w, obiviously vs2005 crashes as it should :)
> >
> > with char device[] you are saying to the compiler to allocate
> > a char array sized as the length of the provided string + trailing
> > \0 it's the same of char device[6] (or whatever) and then filling
> > the content.
> >
> > Anyway a space or a ? or a x should be more readable
> 
> I updated the patch to use a '?' instead 'D' to avoid confusion. In
> addition, I removed in the new patch the code to skip trailing margin,
> because I'm planning to strip leading & trailing margins in a more
> general way in stream_vcd.c so that VCD will be supported even with
> -demuxer lavf; I'll send that patch until this one gets applied.

mplayer vcd:// -cdrom-device e:
on mingw works for me with this patch

anyone care to apply it?
-compn



More information about the MPlayer-dev-eng mailing list