[vorbis] Seekable test
Olaf van der Spek
Olaf at XCC.TMFWeb.NL
Thu Dec 28 09:45:02 PST 2000
----- Original Message -----
From: "Michael Smith" <msmith at labyrinth.net.au>
To: <vorbis at xiph.org>
Sent: Thursday, December 28, 2000 4:47 PM
Subject: Re: [vorbis] Seekable test
> At 04:23 PM 12/28/00 +0100, you wrote:
> >Hi,
> >
> >I'm trying to get the callbacks to work.
> >In my docs, I read this:
> >If successful, fseek returns 0. Otherwise, it returns a nonzero value. On
> >devices incapable of seeking, the return value is undefined.
> >
>
> >I think this should be: if (!offset) or if (offset != 0)
>
> Probably so. Every implementation of stdio I've seen actually returns -1
in
> this case, though (since that's what lseek returns for the error case, and
> unixes as well as windows use lseek as the underlying call).
Yes, but if you don't use those calls in normal code and return 1 (as the
docs say), you get a wrong error.
Maybe this should be added to the docs?
>
> I suspect there's a (possibly historical, or related to broken
> implementations) reasons for this being this way, though, so I'm hesistant
> to change it. Just return -1, makes things easier.
>
> Of course, that documentation says that the return value is undefined for
> unseekable devices. Which means it could return 0 (success), which is
> completely useless.
Indeed. Maybe a better seekable test would be:
To try to seek and check with the tell func if the seek worked.
>
> Michael
>
> --- >8 ----
> List archives: http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
> containing only the word 'unsubscribe' in the body. No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis
mailing list