[vlc-devel] [PATCH 04/11] qt: save/retrieve video filters to/from the playlist

Thomas Guillem thomas at gllm.fr
Mon May 29 18:52:58 CEST 2017


---
 modules/gui/qt/components/extended_panels.cpp | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index de070d3625..b66297ac30 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -93,13 +93,18 @@ static QString OptionFromWidgetName( QObject *obj )
 
 static inline void setup_vfilter( intf_thread_t *p_intf, const char* psz_name, QWidget *widget )
 {
-    vlc_object_t *p_obj = ( vlc_object_t * )
-        vlc_object_find_name( p_intf->obj.libvlc, psz_name );
+    const char *psz_filter_type = GetVFilterType( p_intf, psz_name );
+    if( psz_filter_type == NULL )
+        return;
+
+    char *psz_filters = var_InheritString( THEPL, psz_filter_type );
+    if( psz_filters == NULL )
+        return;
+
     QCheckBox *checkbox = qobject_cast<QCheckBox*>( widget );
     QGroupBox *groupbox = qobject_cast<QGroupBox*>( widget );
-    if( p_obj )
+    if( strstr( psz_filters, psz_name ) )
     {
-        vlc_object_release( p_obj ); \
         if( checkbox ) checkbox->setChecked( true ); \
         else if (groupbox) groupbox->setChecked( true ); \
     }
@@ -108,6 +113,7 @@ static inline void setup_vfilter( intf_thread_t *p_intf, const char* psz_name, Q
         if( checkbox ) checkbox->setChecked( false );
         else if (groupbox) groupbox->setChecked( false );
     }
+    free( psz_filters );
 }
 
 #define SETUP_VFILTER( widget ) \
@@ -309,13 +315,10 @@ static void ChangeVFiltersString( struct intf_thread_t *p_intf, const char *psz_
     /* Vout is not kept, so put that in the config */
     config_PutPsz( p_intf, psz_filter_type, qtu( result ) );
 
-    /* Try to set on the fly */
-    if( !strcmp( psz_filter_type, "video-splitter" ) )
-    {
-        playlist_t *p_playlist = THEPL;
-        var_SetString( p_playlist, psz_filter_type, qtu( result ) );
-    }
-    else
+    var_SetString( THEPL, psz_filter_type, qtu( result ) );
+
+    /* Try to set non splitter filters on the fly */
+    if( strcmp( psz_filter_type, "video-splitter" ) )
     {
         vout_thread_t *p_vout = THEMIM->getVout();
         if( p_vout )
-- 
2.11.0



More information about the vlc-devel mailing list