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

Mark Lee mark.lee at capricasoftware.co.uk
Fri Aug 31 17:26:52 CEST 2012


Talking to myself again...

On 30 August 2012 21:39, Mark Lee <mark.lee at capricasoftware.co.uk> wrote:

>
> 1. If you enable the equalizer filter *after* you start playback, it will
> 'forget' to keep the equalizer enabled after you stop/start.
>
> 2. If you enable the equalizer filter *before* you start playback, it will
> 'remember' and keep the filter enabled even after you stop/start the media
> multiple times.
>

src/audio_output/common.c relates...

1. If you enable the filter after you start playback, an aout exists and a
new filter chain string gets set on the aout object. When you subsequently
stop the media the aout goes away - then when you start again you get a new
aout with no filter chain and hence no enabled filter.

2. If you enable the filter before you start playback, an aout does *not*
exist and the filter chain string gets set in "config". When you
subsequently stop the media the aout goes away - then you start again you
get a new aout and this time the previous filter chain is restored from
config and the audio filter is enabled.

In aout_ChangeFilterString() in common.c there is this code, where psz_new
is the new filter chain string:

743    if( p_aout )
744        var_SetString( p_aout, psz_variable, psz_new );
745    else
746        config_PutPsz( p_obj, psz_variable, psz_new );

My first idea to fix this issue is simply to always store the audio filter
chain in the config even if there is an aout, so:

743    if( p_aout )
744        var_SetString( p_aout, psz_variable, psz_new );
745    config_PutPsz( p_obj, psz_variable, psz_new );

This works... but I'm not sure how correct it is.

If that is acceptable I will send another patch, if not I'll dig some more.

Any comments or other ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120831/20151beb/attachment.html>


More information about the vlc-devel mailing list