[vlc-devel] [RFC] Regarding the use of *_Control()
pdherbemont at free.fr
Mon Apr 14 13:27:41 CEST 2008
I am wondering why *_Control() type function are used a lot in VLC.
To sum up:
*_Control( obj, CONTROL, args...)
To me this produce some difficultly readable code, such as:
- demux_Control( in->p_demux, DEMUX_SET_NEXT_DEMUX_TIME, i_time )
- demux_set_next_demux_time( in->p_demux, i_time )
should have been enough.
I do understand that to do subclassing, and to add new functionality
to Control() function without breaking the ABI is quite easy.
I do doubt that this is a nice habit, and having internal function
pointers would have been much cleaner IMO. (no need to switch(), it's
easy to see if a function is supported or not, etc.)
For now I do plan to remove all public call to demux_Control, and
internalize them. (Next up would be to completely remove them...)
What do you think?
More information about the vlc-devel