[vorbis-dev] Yet another vf question...

Michael Smith msmith at xiph.org
Tue Dec 16 17:16:49 PST 2003



On Tuesday 16 December 2003 18:48, John Morton wrote:
> Should I ov_clear a failed ov_open/test/test_open call?
>

No. I _think_ vorbisfile internally does this on failure, you shouldn't repeat 
it (but it should be harmless?).

> The xmms plugin does an fclose on failure, and that seems to work, but I
> thought I ought to know for certain.

Shouldn't be neccesary, should be fairly harmless.

>
> (An observation: I think the quantity of questions and bugs raised along
> the lines of "I did open file, ov_open, ov_read, close file, open another
> file, ov_read, and it exploded", or "I tried to make vorbisfile go in [some
> language with a deceptively C like stdio] and it didn't work" are probably
> due to the asymmetry in the callback set - there are callback hooks for
> read, seek, tell and close, but none for open. Is there any particular
> reason for this? (I realize it's to late in the day to fix the API in any
> fashion, but it's possible that oggfile might be able to avoid this API
> usability flaw.))

There's no good reason for an open callback, really. I would argue that close 
doesn't really belong in vorbisfile either, Monty disagrees (and I don't feel 
strongly on that point). It's relatively difficult to do it sensibly, too - 
opening a generic byte-source-object-which-might-be-filelike-but-might-not 
can be fairly complex, fopen() like parameters would probably be 
insufficient.

<p>Mike

--- >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-dev-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-dev mailing list