[vlc-devel] [PATCH] libvlc API: Add equalizer to audio.c

Rémi Denis-Courmont remi at remlab.net
Tue Jul 7 12:06:08 CEST 2009


On Tue, 07 Jul 2009 09:57:29 +0200, Cyril MATHE
<cmathe at actech-innovation.com> wrote:
> Le lundi 06 juillet 2009 à 17:55 +0300, Rémi Denis-Courmont a écrit :
>> Le lundi 6 juillet 2009 11:11:57 Cyril MATHE, vous avez écrit :
>> > Hello,
>> >
>> > This patch adds new feature to audio.c : equalizer.
>> >
>> > libvlc_audio_set_eqz_enable(int b_enable): enable or disable equalizer
>> > libvlc_audio_set_eqz_preset(int i_preset): set an equalizer preset
>> > libvlc_audio_set_eqz(libvlc_audio_eqz_t eqz): set an equalizer
>> > libvlc_audio_get_eqz_preset(int i_preset): get an equalizer preset
>> > libvlc_audio_get_eqz(): get current equalizer
>> 
>> The asprintf() error handling looks broken to me.
> it is not. the asprintf line is (comes from equalizer.c):
> asprintf( &psz, "%s %lld.%07llu", psz_newbands ? psz_newbands : "",
> d.quot, d.rem ) == -1 )
> so we need an unsigned long for d.rem but it is said in man :
> EXAMPLE
>        After
>                div_t q = div(-5, 3);
>        the values q.quot and q.rem are -1 and -2, respectively.
> this is why we need it. The sign is changed before and after lldiv to
> have not negative d.rem value and to conserve the number sign

Sorry, I do not see the relevance of your rant on the (idiotic indeed)
semantics of the American integer division, to my complaints on the _error_
handling of the asprintf() call. 

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list