[vlc-devel] [PATCH v2] libvlc: equalizer: Use ISO bands instead of VLC bands

Ron Wright logiconcepts819 at gmail.com
Wed Mar 19 01:16:12 CET 2014


On Tue, Mar 18, 2014 at 2:47 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le lundi 17 mars 2014, 19:37:14 Ronald Wright a écrit :
>> This eliminates the inconsistency between the equalizer bands that are
>> portrayed by the API and the bands that are actually used by the equalizer
>> module.
>> ---
>>  lib/media_player.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/lib/media_player.c b/lib/media_player.c
>> index 7df46f4..ddf12b8 100644
>> --- a/lib/media_player.c
>> +++ b/lib/media_player.c
>> @@ -489,6 +489,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
>>
>>      /* Equalizer */
>>      var_Create (mp, "equalizer-preamp", VLC_VAR_FLOAT);
>> +    var_Create (mp, "equalizer-vlcfreqs", VLC_VAR_BOOL);
>>      var_Create (mp, "equalizer-bands", VLC_VAR_STRING);
>>
>>      mp->p_md = NULL;
>> @@ -1502,12 +1503,14 @@ int libvlc_media_player_set_equalizer(
>> libvlc_media_player_t *p_mi, libvlc_equal }
>>
>>      var_SetFloat( p_mi, "equalizer-preamp", f_preamp );
>> +    var_SetBool( p_mi, "equalizer-vlcfreqs", false );
>
> Seems like a no-op.
>
>>      var_SetString( p_mi, "equalizer-bands", psz_bands );
>>
>>      audio_output_t *p_aout = input_resource_HoldAout(
>> p_mi->input.p_resource ); if ( p_aout )
>>      {
>>          var_SetFloat( p_aout, "equalizer-preamp", f_preamp );
>> +        var_SetBool( p_aout, "equalizer-vlcfreqs", false );
>
> Ditto, even more so.
>
>>          var_SetString( p_aout, "equalizer-bands", psz_bands );
>>
>>          vlc_object_release( p_aout );
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

I have done run-time analysis with and without the var_SetBool() calls
included, and you are right.  The var_SetBool() calls are no-ops, and
ISO bands are used in libvlc instead of VLC bands in either case.  I
have read the function definition of var_Create(), and this is why it
happens.  The var_Create() call detects the VLC_VAR_BOOL flag, and it
sets the value referenced by the specified variable to false,
regardless of the default value.  Therefore, I do not need to set the
variable to false later on.

I also compared my patched version with the latest Android VLC
nightly, and the nightly still uses the VLC bands rather than the ISO
bands.  So, it is now clear to me that a simple call to var_Create()
in the libvlc_media_player_new() function is all that is needed to fix
the inconsistency.  I did not mean to sound stubborn, as I still do
not understand the internals of VLC very well.

I shall send version 3 of the patch with the var_SetBool() calls removed.

Regards,

Ron Wright



More information about the vlc-devel mailing list