This Time Self-Hosted
dark mode light mode Search

xine’s new QuickTime demuxer

Today I started some maintenance work for xine-lib, trying to get rid of a function I looked to get rid of in quite some time (the xine malloc wrapper). Issue after issue, I came down to working on the QuickTime demuxer. It’s quite a huge demuxer, and widely used nowadays as it’s the one used for Mpeg4 files (like m4a).

The big complex part of the demuxer is the parser for the moov atom, which contains all the important information about the file.

Right now, I have a huge rewrite of the basic parser function that, instead of going on and on and on with “if” conditions, contains a series of tables which are used by a single parsing function to execute a series of callbacks when the atoms are found.

The new code is bigger, as the functions are never inlined (their pointer is taken), it might be slower because it’s looking at the tables at runtime, but it’s certainly more readable than the previous code, and easier to maintain, which is quite an important factor considering that there are only two xine developers out there, me and Darren.

I’m not even sure if it actually is slower, because the old code was quite complex, and I wouldn’t be surprised if at the end of the day my code ends up being on par with the original.

If from one side I like doing this work, I really need to find the motivation to restart working on 1.2 series. This huge rewrite will probably fall in 1.1, for a series of reasons. It doesn’t require changes to the API so it’s fine that way. But it would be quite more simpler if I could have some better support from xine, like decent lists and similar.

Tomorrow I’ll take a day off and play, hopefully it will recharge me, today I spent almost all day long between 10 in the morning to the next 1 am on xine-lib’s code, that’s more than 12 hours spent on coding, especially on something like xine-lib which… well isn’t exactly the nicest hobby one might have.

The slowness in xine’s build doesn’t help either. Even with ccache, it forces me to relink every time I run install, even just for plugins. I should see if it would solve to remove freetype’s libtool archive, as that’s what is warning me a lot about.

And I forgot to say that there seems to be problem with the latest FFmpeg SVN, which I haven’t checked yet. Sigh!

Bribes are welcome, although at the moment I’d be happier to know if I have a new contract this summer so I can afford a new box. Thanks to “Joe User” I now know where to find what I need, and it doesn’t even cost too much (just €1600 for an 8-core), I just need a couple more contracts…

Comments 2
  1. why not use lavf demuxer ?i’m sure this has been asked before, is it written down in a faq somewhere?

  2. Doubt it’s written down in a FAQ. Anyway to use lavf, xine would need a pretty complete rewrite of the demuxing interface and logic, which can’t be done for 1.1 and I’m unlikely to do for 1.2, it’s more than likely that if anything it will be in 2.0 (which might follow 1.2).

Leave a Reply to compnCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.