xine fixes and improvements

So, today I finally found and fixed the last big bug with xine-lib and AAC, the collision between xine’s faad copy and ffmpeg linking with libfaad.so.

But of course, I couldn’t stop there, so I thought of adding more visibility scope declarations to the other plugins so that they can actually improve.
Unfortunately doing the work as I originally started, that is, hiding all the symbols that can be hidden, wasn’t a good idea. There is only one symbol that has to be exported for sure by all the plugins, and it’s the structure that xine uses to load the data of the plugin. An exception is for the real audio / real video plugins that tries to load real codecs (tries because I’m afraid on AMD64 they don’t really do much useful things and I’m probably going to drop them entirely sooner or later).

Anyway, seen that the original way wasn’t feasible, I thought that this might have been a good idea for trying the -fvisibility=hidden flag applied in a sane way. Why I say “a sane way”? Because with the notes I written above (only one symbol a part exceptions), I can easily mark that single symbol to be exported (together with the needed functions for real codecs) and then hide the whole rest without second thoughts.

The problem is, to patch all that stuff is not easy, and I’m now with a 77KB patch waiting to be tested to see if it can work out.
Hopefully, if this works out, the time needed for xine, kaffeine, amaroK to start will be really decreased, with also their memory footprint.

So one might ask, why I’m totally against use of -fvisibility=* in KDE but I’m using it? Well first of all, I’m not using it on the whole xine-lib stuff, but just for the plugins that have a framework that’s not dynamic: one symbol and that’s all (a part known exceptions); then xine-lib is not C++ code, where you have to handle stuff like typeinfo and exceptions, that if missing leads to big breakages and ABI changes.

A final note is derived by something lfranchi from amaroK said a while ago while talking about this improvement. This is not my day job, but I spent this whole day (that’s national holiday in Italy) working on this, from 15 CEST (now is 2am CEST, but I’m not sure if I’m done yet). I just hope my day job is easier than this, it would compensate to the whole I do without being paid at all 😉