[vlc-devel] [vlc-commits] commit: Qt: save volume on exit (Francois Cartegnie )
Laurent Aimar
fenrir at elivagar.org
Thu Jul 29 14:42:06 CEST 2010
Hi,
On Thu, Jul 29, 2010 at 01:29:12PM +0200, git at videolan.org wrote:
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 29 13:28:27 2010 +0200| [47e8817acdc58829acfbf5d02913007164b0a0bf] | committer: Francois Cartegnie
>
> Qt: save volume on exit
>
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47e8817acdc58829acfbf5d02913007164b0a0bf
> ---
>
> modules/gui/qt4/qt4.cpp | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
> index d689c4a..c50327d 100644
> --- a/modules/gui/qt4/qt4.cpp
> +++ b/modules/gui/qt4/qt4.cpp
> @@ -507,6 +507,17 @@ static void *Thread( void *obj )
> /* Save the path */
> getSettings()->setValue( "filedialog-path", p_intf->p_sys->filepath );
>
> + /* Save volume on exit */
> + audio_volume_t i_volume;
> + module_config_t *volconf;
> + if ( var_InheritBool( p_intf, "qt-autosave-volume" ) )
> + aout_VolumeGet( p_intf, &i_volume );
> + else
> + i_volume = config_GetInt( p_intf, "qt-startvolume" );
> + config_PutInt( p_intf, "volume", i_volume );
Unless I am wrong, you don't need to change "volume". The aout core
already does it. If confirmed, that part should be reverted.
> + volconf = config_FindConfig( VLC_OBJECT(p_intf), "volume" );
> + if ( volconf ) volconf->b_autosave = true;
Not thread safe and so not acceptable.
Using change_autosave() is probably the right way (in src/libvlc-module.c).
Regards,
--
fenrir
More information about the vlc-devel
mailing list