[vlc-commits] [Git][videolan/vlc][3.0.x] qt: fix and simplify module lookup in preferences search

Jean-Baptiste Kempf gitlab at videolan.org
Sat Jun 19 08:10:54 UTC 2021



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
bb903dd5 by Lyndon Brown at 2021-06-19T07:51:56+00:00
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.

(cherry picked from commit eb7c25a7e29632ffe8f68bcfa649ab216c12148a)

- - - - -


1 changed file:

- modules/gui/qt/components/complete_preferences.cpp


Changes:

=====================================
modules/gui/qt/components/complete_preferences.cpp
=====================================
@@ -495,7 +495,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();



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bb903dd5e0d0525b0c39c78d421c5910278ae5cd

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bb903dd5e0d0525b0c39c78d421c5910278ae5cd
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list