[Flac-dev] Re: [Flac-dev]: flac and pipes problems

Josh Coalson xflac at yahoo.com
Thu Jun 7 13:11:23 PDT 2001


> > autodetection that should be sufficient.  Basically, since the
> > case we really care about is pipe input and ungetc only guarantees
> > you 4 characters, it just checks for 'RIFF'.
>       ^
> Where is that figure from?  Per POSIX and SUSv2 _one_ character of
> push-back is guaranteed.
> 
eeewww, yes, it looks like you are correct.

so I bit the bullet and did autodetect the correct way.  now
it will read the first 12 bytes of the file and check for
RIFFxxxxWAVE.  and instead of ungetc()ing it, I changed the
wav and raw readers to use up the lookahead first.  not trivial
when you consider pipes and --skip, but it had to be done.

even though this didn't make it into 0.10, ungetc seems to handle
4 calls on every platform I tested on (glibc, msvc, solaris).

Josh


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/




More information about the Flac-dev mailing list