[vlc-devel] [PATCH] Add new API to libvlc for persistent equalizer settings.

Alexey Sokolov alexey at asokolov.org
Tue Aug 28 04:36:20 CEST 2012


28.08.2012 09:29, Rémi Denis-Courmont пишет:
>    Hello,
>
> On Tuesday 28 August 2012, Alexey Sokolov wrote:
>>> +/***********************************************************************
>>> ****** + * libvlc_audio_equalizer_get_preset_name : Get the name for a
>>> preset +
>>> ************************************************************************
>>> *****/ +const char *libvlc_audio_equalizer_get_preset_name( unsigned
>>> u_index ) +{
>>> +    if ( u_index >= NB_PRESETS )
>>> +        return NULL;
>> Please set an error message via libvlc_printerr( "..." ); when an error
>> is detected.
> That's not necessary. The function cannot fail with valid arguments. There is 
> no ambiguity as to why the result is NULL: the index was out of range.
You need to know how the function works internally to say that.
I thought that users of libvlc don't need to know the implementation of
every method and under which circumstances they return NULL.

And the readable error message won't hurt for such wrong uses of the
function anyway.
> An error would if the function failed inspite of valid input parameters.
>
>>> +
>>> +    return preset_list_text[ u_index ];
>>> +}


-- 
Best regards,
Alexey "DarthGandalf" Sokolov


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120828/f9d86975/attachment.sig>


More information about the vlc-devel mailing list