Even more xine improvements today

So, after removing a few thousands (yes, thousands) lines of code in a new xine-lib-1.2-plugins-changes branch, I’ve decided to start working on yet another branch. This time the name for the branch is xine-lib-1.2-libavutil.

As the name suggests, it’s a branch designed to get support for libavutil in xine-lib, basically replacing xine-lib’s code with libavutil whenever possible.

Right now I have at least three features used by xine’s plugins that I can factor out to libavcodec: CRC, SHA1 and Base64 implementations.

CRC is currently used by the A52 decoder, by DVB input and by the TS demuxer; libxine carries an implementation, while the A52 decoder uses a52dec’s internal code to perform CRC16 instead. In the new branch all these three plugins use libavutil, and link against it, sharing the CRC data table and the code, while the implementation in libxine is gone, disappeared.

SHA1 is used by CDDA plugin, which is also one of the two users of Base64. SHA1 and Base64 are used to handle CDDB fetching. The current CDDA plugin has its own implementation of both, while on the new branch it once again uses libavutil. The result? The shared object of the plugin is 20KB smaller than the original.

Today’s balance is not bad: two files removed from the main branch (dummies used by directfb to build the X11 and FB versions), five files gone from the -avutil branch, and a few thousands lines of code gone from the -pc branch.

Tomorrow I’ll see if I can get xine_xmalloc replaced with av_mallocz; this is going to be a huge change, and I’m not sure if I want to take that step yet, but it would be a nice thing to get rid of all the implementations in xine-utils that we don’t really need as part of xine.

Oh I have a patch to send to ffmpeg-devel now, too.