[MPlayer-cvslog] r25404 - trunk/stream/vcd_read_darwin.h

Ulion ulion2002 at gmail.com
Sat Dec 15 13:58:09 CET 2007


2007/12/15, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Sat, Dec 15, 2007 at 01:17:52PM +0100, ulion wrote:
> > Author: ulion
> > Date: Sat Dec 15 13:17:51 2007
> > New Revision: 25404
> >
> > Log:
> > The buffer used for pread need be aligned, but currently it's not.
> > This will cause the pread always got random data so can not play vcd.
> > Fixed by move the buffer ahead in the structure to make sure it's aligned.
>
> it must be aligned to what? And this is not a really good solution
> unless I missed something in the C standard that would require it to be
> aligned correctly like this.
> Actually memalign and the gcc-specific __attribute__ are the only ways
> to ensure alignment I know of.
> Well, putting it in a union with something of the right size (like
> uint32_t or uint64_t) maybe, but that seems even uglier...

sizeof(CDMSF) == 3, indeed, that make the struct head to the buf got a
offset 23.
the vcd read function is total broken with this offset and took me one
day to figure out why the pread always got different data even with
same offset.
change the position of buf in that structure is the easiest way to fix
this problem on my machine.
As why the pread need it be aligned, I think only apple knows.

-- 
Ulion



More information about the MPlayer-cvslog mailing list