[MPlayer-dev-eng] c++ version of mplayer.c

Jan Volf javol at volny.cz
Fri Feb 11 13:18:00 CET 2005


Hi,

I'm quite disappointed by the discussion here.
C++ itself does not help anything but the OO approach would definitely 
do and the OO approach or some kind of rules that each part of code has 
to conform to is what this project completely lacks. Just look in to 
main function, it is mess. The globals are everywhere even in cases 
where there is no reason for them (in fact there's no reason for any of 
them :). This code is unmanageable. The core of mplayer is written in 
one function counting several thousands of lines - insane!!!
I know that the C++ is far from being good OO language and makes no 
sense to rewrite all code in it. You can simply take OO approach and 
write in pure C but there should be some rules. The first one is that 
there should be NO globals - it's real pain.
Month ago I started to rewrite the main function's code to separate 
real mplayer's core from user interface and high level code. I'm 
writing it in pure C just using structures to simulate OO approach. The 
purpose is to create player engine for the UI that can be platform/OS 
dependent. First I thought it would be easy just dividing the main in 
to several functions to create entry points for my UI. Now I know that 
I was fool to think this way. Though, I'm continuing the process 
regardless it will be welcomed here (now I'm very sceptic about it), If 
nothing it well help me in my project, otherwise I would have thrown it 
in the thrash.

Best regards,
Jan Volf
MPlayer OS X developer




More information about the MPlayer-dev-eng mailing list