[vlc-commits] qt: save/retrieve video filters to/from the playlist

Thomas Guillem git at videolan.org
Wed May 31 17:45:22 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon May 29 11:55:23 2017 +0200| [760de52972c5fb07c05d1e934a883020f1200d16] | committer: Thomas Guillem

qt: save/retrieve video filters to/from the playlist

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=760de52972c5fb07c05d1e934a883020f1200d16
---

 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 d4df20fc6d..e3471057ec 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -104,13 +104,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( filterIsPresent( qfu(psz_filters), qfu(psz_name) ) )
     {
-        vlc_object_release( p_obj ); \
         if( checkbox ) checkbox->setChecked( true ); \
         else if (groupbox) groupbox->setChecked( true ); \
     }
@@ -119,6 +124,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 ) \
@@ -320,13 +326,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 )



More information about the vlc-commits mailing list