[vlc-commits] qt: fix and simplify module lookup in preferences search

Lyndon Brown git at videolan.org
Fri Sep 25 09:26:07 CEST 2020


vlc | branch: master | Lyndon Brown <jnqnfe at gmail.com> | Fri Apr 19 04:03:35 2019 +0100| [eb7c25a7e29632ffe8f68bcfa649ab216c12148a] | committer: Pierre Lamot

qt: fix and simplify module lookup in preferences search

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.

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

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

 modules/gui/qt/dialogs/preferences/complete_preferences.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
index e6b7c6677d..dc02c1a6f1 100644
--- a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
+++ b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
@@ -496,7 +496,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();



More information about the vlc-commits mailing list