[vlc-devel] [PATCH] GUI-Qt: update components/extended_panels.cpp

Hugo Beauzée-Luyssen hugo at beauzee.fr
Tue Apr 25 13:08:17 CEST 2017


On Tue, Apr 25, 2017, at 03:03 PM, Victorien Le Couviour--Tuffet wrote:
> Retrieve already loaded audio and video filters at window construction.
> This fixes the bug occuring when enabling or disabling a filter from Qt:
> it was rebuilding a filter chain adding or removing the concerned filter,
> but as it didn't retrieved the ones that were already there (enabled
> through
> command line), there were just thrown away.
> ---
>  modules/gui/qt/components/extended_panels.cpp | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/modules/gui/qt/components/extended_panels.cpp
> b/modules/gui/qt/components/extended_panels.cpp
> index 39d88b90d3..e16db16c7b 100644
> --- a/modules/gui/qt/components/extended_panels.cpp
> +++ b/modules/gui/qt/components/extended_panels.cpp
> @@ -99,6 +99,23 @@ static inline void setup_vfilter( intf_thread_t
> *p_intf, const char* psz_name, Q
>      setWidgetValue( ui.widget ); \
>      CONNECT( ui.widget, signal, this, updateFilterOptions() );
>  
> +static inline void
> +retrieve_filters(intf_thread_t *intf,
> +                 vlc_object_t *obj, char *psz_filter_type)

nitpick: psz_filter_type should be const

> +{
> +    char        *filters;
> +
> +    if (obj)
> +    {
> +        if ((filters = var_GetString(obj, psz_filter_type)))
> +        {
> +            config_PutPsz(intf, psz_filter_type, filters);
> +            free(filters);
> +        }
> +        vlc_object_release(obj);

Granted it makes the code cleaner here, but I don't like function
silently taking ownership. I can't wait for us start using unique_ptr &
friends O:-)

> +    }
> +}
> +
>  ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) :
>              QObject( _parent ), p_intf( _p_intf )
>  {
> @@ -225,6 +242,9 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf,
> QTabWidget *_parent ) :
>               ui.cropBotPx, setDisabled( bool ) );
>      CONNECT( ui.leftRightCropSync, toggled( bool ),
>               ui.cropRightPx, setDisabled( bool ) );
> +
> +    retrieve_filters(p_intf, (vlc_object_t *)THEMIM->getAout(),
> "audio-filter");
> +    retrieve_filters(p_intf, (vlc_object_t *)THEMIM->getVout(),
> "video-filter");
>  }
>  
>  void ExtVideo::cropChange()
> -- 
> 2.12.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list