[vlc-devel] [PATCH] lib: fix typos in libvlc_media_player_set_equalizer

Mark Lee mark.lee at capricasoftware.co.uk
Mon Jun 16 17:34:54 CEST 2014


Hi...

On 16 June 2014 15:47, Adrien Maglo <magsoft at gmail.com> wrote:

> This commit repairs the libvlc equalizer API.
> ---
>  lib/media_player.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/media_player.c b/lib/media_player.c
> index 4477a6a..5225079 100644
> --- a/lib/media_player.c
> +++ b/lib/media_player.c
> @@ -1497,7 +1497,7 @@ int libvlc_media_player_set_equalizer(
> libvlc_media_player_t *p_mi, libvlc_equal
>      {
>          for( unsigned i = 0, c = 0; i < EQZ_BANDS_MAX; i++ )
>          {
> -            c = snprintf( bands + c, sizeof(bands) - c, " %.07f",
> +            c += snprintf( bands + c, sizeof(bands) - c, " %.07f",
>                            p_equalizer->f_amp[i] );
>              if( unlikely(c >= sizeof(bands)) )
>                  return -1;
> @@ -1517,7 +1517,7 @@ int libvlc_media_player_set_equalizer(
> libvlc_media_player_t *p_mi, libvlc_equal
>              var_SetString( p_aout, "equalizer-bands", bands );
>          }
>
> -        var_SetString( p_mi, "audio-filter", p_equalizer ? "equalizer" :
> "" );
> +        var_SetString( p_aout, "audio-filter", p_equalizer ? "equalizer"
> : "" );
>

Are you sure about this?

I sent the original patch for the equalizer in LibVLC, but it was a while
ago and I'm afraid I don't now remember all the detail of why I did it the
way I did it, but I can remember that I tested it a lot.

I wanted to make it so that:

1. you could set the equalizer *before* an audio output was created (i.e.
before you played anything), and it would be applied automatically when the
media started; and
2. those settings would be retained and automatically applied when playing
one media after another.

Does this patch still work in that regard if you set it on the aout rather
than the media player instance?


>          vlc_object_release( p_aout );
>      }
>
> --
> 1.9.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>


-- 
Mark Lee
mark.lee 'at' c <http://mark-lee.com>apricasoftware.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140616/f82bad80/attachment.html>


More information about the vlc-devel mailing list