Commits on Source (5)
-
If cb == NULL, ret will keep the VLC_EGENERIC value and the next item will be loaded without additional effects. Better discard the current module and early-continue to avoid the additional indentation level and make it clearer that a cb == NULL will lead to the module being skipped.
c3c40f68 -
a809e649
-
Factor the call to module_need() so it can be changed into vlc_module_match in one shot. No functional changes.
74004507 -
vlc_module_match will allow replacing the module activation function, but more importantly allows setting the filter->p_module member attribute so that filters can actually know which filter is being loaded when names are supplied to the loading function. For instance: filter_t *filter = filter_chain_AppendFilter( chain, "filter1,fallback1", cfg, fmt_out); would try filter1, then fallback1, with `filter->psz_name` being set to filter1,fallback1, and `filter->p_module` to `NULL`. By setting `filter->p_module` beforehand, an activation function can check which (sub)module is being loaded and adapt its behaviour accordingly.
62fdad12 -
Before the previous commit, the activation function was implicitely of type int (*)(vlc_object_t *) because module_need was used. But the following commits changed the activation function for the modules: - 95c45826 - c9f42135 - f9ab141d - b027f1a6 - 94e23d51 - 0d5d447d - 1c87e290 It led to the activation function being called with non-matching parameters, which is UB and crashes on some platforms where types are checked, like when executing from WASM VMs. This commit explicitely changes the type to a matching one for every filter type.
ea5fb3c2