[vlc-devel] [PATCH]: qt: fix unreliable preferences search

Pierre Lamot pierre at videolabs.io
Wed Sep 23 10:12:43 CEST 2020


OK

On 2020-09-23 02:32, Lyndon Brown wrote:
> patch attached. preview below.
> 
> the Qt advanced preferences search is unreliable, making mistakes in 
> how it
> checks the option sets corresponding to nodes. the fix is tiny and
> straight forward.
> 
> from commit log:
> ----------------
> 
> 1) for module (plugin) tree nodes, the object already holds a pointer 
> to
> the associated module object is was created for, so we can use that
> directly instead of wastefully doing a module_find() search.
> 
> 2) the module_find() search actually is unreliable; modules can be
> mis-identified through it.
> 
> to explain the second point: from investigating a crash with the Qt 
> prefs
> search facility, in relation to a commit that happens to expand the 
> number
> of plugins with empty config sets, a flaw was identified (fixed 
> separately)
> relating to the search code not getting the NULL pointer it was 
> expecting
> in the case of empty module sets, however it did not explain why the 
> search
> code was actually encountering modules with empty option sets in the 
> first
> place, since only plugins with non-empty sets were being added to the
> prefs tree; digging into this, an example module where this was the 
> case
> was an 'a52' module; the one being looked at by the search code was the
> packetizer one, which has no options, but the entry in the tree for 
> which
> the code was working on was the codec one, which has an option; it 
> turned
> out that the search code was wrongly assessing the option set of the
> packetizer 'a52' module instead of the codec one because the
> module_search() call had pointed to the wrong 'a52' module.
> 
> diff --git
> a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
> b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
> index eb8a3e0bff..d17a721a1e 100644
> --- a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
> +++ b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
> @@ -509,7 +509,7 @@ bool PrefsItemData::contains( const QString &text,
> Qt::CaseSensitivity cs )
>      if( this->i_type == TYPE_CATEGORY )
>          return false;
>      else if( this->i_type == TYPE_MODULE )
> -        p_module = module_find( this->psz_shortcut );
> +        p_module = this->p_module;
>      else
>      {
>          p_module = module_get_main();
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list