[vorbis-dev] Re: [vorbis] ao changes

Kenneth Arnold ken at arnoldnet.net
Tue Aug 28 08:25:24 PDT 2001


On Mon, Aug 27, 2001 at 07:42:18PM -0700, volsung at asu.edu wrote:
> Boy, you want this feature, don't you?  :)

It's just one of those things that's not too hard to implement and is
necessary to accomplish one of the few things still left before I'd
pronounce ogg123 generally usable, so naturally...

> I would rather make it another member of the ao_info struct, but that would
> break the current client apps. In order to not break backward compatibility
> with the current library API, I will do this by adding an ao_get_extension()
> to the library and an ao_plugin_get_extension() to the plugin API (which
> *will* break that API, but I don't care since I can change all the plugins
> anyway).

Plugin extensions will work; consider an ioctl-like interface to keep
binary compatibility.

> [Aside: Adding members to a C struct destroys backward compatibility,
> right?  That sounds obvious, but I just want to check.]

If you're passing and using pointers, not necessarily. It's generally
possible, assuming that the padding is the same, to store a pointer to
the new struct into a pointer to the old struct and access the members
you know are there. If you leave all the elements at the beginning of
the struct the same, old programs should get the right data. The
problem is knowing which structure the pointer really points to -- a
new-API app could be using an old-API libao, or vice versa, and it can
get difficult and delicate to keep everything right. Also, the moment
the client program uses a local copy of the structure, the above
assumptions become immediately invalid.

Win32 solves this problem by providing a header structure with a
version/identification number and a pointer to the contents structure,
which is cast into the appropriate structure based on the version. It
definately works, but makes simple things like creating a DIB very
tedious -- I must have spent half an hour with the docs on MSDN and
still couldn't get it to work right, so just gave up.


-- 
Kenneth Arnold <ken at arnoldnet.net> / kcarnold / Linux user #180115
http://arnoldnet.net/~kcarnold/



<HR NOSHADE>
<UL>
<LI>application/pgp-signature attachment: stored
</UL>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/octet-stream
Size: 233 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20010828/42ec3343/part-0001.obj


More information about the Vorbis-dev mailing list