Skip to content

frontend,libobs: Add Program Files plugin path and module dedup check#13203

Closed
marcusbooker77 wants to merge 1 commit intoobsproject:masterfrom
marcusbooker77:pr/plugin-loading-improvements
Closed

frontend,libobs: Add Program Files plugin path and module dedup check#13203
marcusbooker77 wants to merge 1 commit intoobsproject:masterfrom
marcusbooker77:pr/plugin-loading-improvements

Conversation

@marcusbooker77
Copy link

Summary

Two small improvements to the Windows plugin loading system:

1. Add Program Files plugin search path (OBSBasic.cpp)

Adds C:\Program Files\obs-studio\obs-plugins\64bit\ as an additional module search path in AddExtraModulePaths(). This allows development/custom builds of OBS to discover and load third-party plugins that were installed by the standard OBS installer into Program Files.

Use case: When building OBS from source for development or testing, third-party plugins (StreamFX, Move Transition, etc.) installed via the official installer are invisible to the dev build. This change makes them available without manual copying.

#if defined(_WIN32)
    {
        char pf[512];
        DWORD pf_len = GetEnvironmentVariableA("ProgramFiles", pf, sizeof(pf));
        if (pf_len > 0 && pf_len < sizeof(pf)) {
            string std_bin  = string(pf) + "/obs-studio/obs-plugins/64bit";
            string std_data = string(pf) + "/obs-studio/data/obs-plugins/%module%";
            obs_add_module_path(std_bin.c_str(), std_data.c_str());
        }
    }
#endif

2. Module deduplication check (obs-module.c)

Adds a check in load_all_callback() to skip modules that have already been loaded from a higher-priority search path. Without this, the same plugin DLL found in multiple search paths would be loaded twice, causing duplicate sources/filters in the UI and potential memory/stability issues.

/* Skip modules already loaded from a higher-priority path. */
if (obs_get_module(info->name)) {
    blog(LOG_DEBUG, "Skipping module '%s' (%s), already loaded",
         info->name, info->bin_path);
    return;
}

Test Plan

  • Dev build discovers plugins from C:\Program Files\obs-studio\obs-plugins\64bit\
  • Plugins appear only once in the source/filter lists (no duplicates)
  • LOG_DEBUG messages confirm dedup is working: "Skipping module 'xxx', already loaded"
  • Portable mode still works (early return in AddExtraModulePaths before the new path)
  • No regressions on Linux/macOS (changes are #if defined(_WIN32) guarded)

Files Changed

File Change
frontend/widgets/OBSBasic.cpp Add Program Files search path in AddExtraModulePaths()
libobs/obs-module.c Add dedup check in load_all_callback()

🤖 Generated with Claude Code

Add standard OBS Studio installation directory to plugin search paths so
third-party plugins from Program Files are available in development builds.
Add dedup check in load_all_callback() to prevent double-loading modules
found in multiple search paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Fenrirthviti
Copy link
Member

We do not accept AI-generated PRs.

In the future, please take the time to read any project's published guidelines before submitting PRs.

@marcusbooker77 marcusbooker77 deleted the pr/plugin-loading-improvements branch March 9, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants