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

Cyril MATHE cmathe at actech-innovation.com
Tue Jul 7 09:57:29 CEST 2009


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

>  Also, I am increasingly wary 
> of merging non-persistent setters/getters, as it means more work for whoever 
> fixes them (not unlikely me).
Right, but in that case it means that we don't add any features to vlc.
Fortunately I can deal with setters/getters I did, and fixes it. ;-)

Best Regards,
	Cyril




More information about the vlc-devel mailing list