Cartoon drawing of a man with a grey beard and glasses.

Martin Kenny's blog

Comparing mplayer and VideoLAN

In trying to get mplayer to play pause-free, I decided to have a look at VideoLAN. Having perused the main loop in mplayer, while trying to figure out my timing problems, I’d seen that it’s code’s not pretty :-). Looking through the VideoLAN code, and looking at the development documentation shows me that the VideoLAN code is more approachable.

I’ve now got the VideoLAN client (vlc) running on the TVapp, but not without some hassles. The problem stems from a piece of code in the XVideo display driver that waits for three X events before continuing on with initialization; it was only receiving two of the three, and so the driver was blocking forever. For now I’ve hard-coded the window width and height, that the driver needed the info for, but I need to look into that further.

As to whether I can get better synchronization with vlc than mplayer, I’m not yet sure. VideoLAN is based on a multi-threaded architecture, which makes it easier to understand, but perhaps a bit more prone to synchronization problems–or perhaps not; I guess I need to properly read the documentation and peruse the code some more. It certainly looks easier to modify, though.