[haiku-development] Re: Donating codes: APE reader

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 05 Jun 2008 10:03:18 +0200 CEST

Hi Shinta,

SHINTA <shinta.0806@xxxxxxxxx> wrote:
> > >  Here is a code which is the static version of APE. Thank you.
> > > http://www2u.biglobe.ne.jp/~shinta/test/APEReaderDonate.zip
> > > http://www2u.biglobe.ne.jp/~shinta/test/LibMonkeysAudioDonate.zip
> >  This code has two problems.
> > 
> >  One is taking long time in CAPEHeader::FindDescriptor(). 1 byte x 
> > 1
> > mega times disk access seems to be slow, although this code worked 
> > well
> > in ZETA.
>  I modified the code, and now, APE reader is fast. Please use 
> attached
> new APEHeader.cpp.

Great, thanks!
It's never a good idea to read single bytes if you don't know wether or 
not the byte stream is buffered or not (BFile is not, for example, but 
maybe it is in Zeta).
In any case, Dano needs a bit more 1 usec per Syscall on my machine - 
that means that by reading 1MB 1 byte after the other, you already 
waste more than 1 second doing syscalls alone. And that will even be a 
lot slower in emulation.

> >  Another is no support for seeking. Seek code doesn't work.
>  Currently, I have no perspective to improve this. But, APE reader 
> can
> play APE files anyway.

In the long run, seeking is mandatory, though. But it's a good start :-
)

Bye,
   Axel.


Other related posts: