Report missing essential modules to the frontend#1737
Closed
summeroff wants to merge 1 commit into
Closed
Conversation
libobs silently skips a module whose file is missing or that fails to expose its OBS exports (MODULE_FILE_NOT_FOUND / MODULE_MISSING_EXPORTS), so such modules never appear in obs_module_failure_info::failures. The structured load-failure list therefore does not reflect a missing core plugin (e.g. obs-ffmpeg, which provides ffmpeg_aac) — the condition behind the startup crashes when the recording audio encoder was absent. Add a positive capability check after module load that verifies the encoders/output/service we depend on are actually registered (ffmpeg_aac, obs_x264, rtmp_output, rtmp_common) and surfaces any gaps through the same moduleLoadFailures list exposed by OBS_API_getModuleLoadFailures, so the frontend can react. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by streamlabs/obs-studio#743. Detecting missing/skipped plugins belongs in libobs (where the load decision is made) rather than reconstructing it in OSN with a positive capability check. #743 records the silent skip paths (MODULE_NOT_OBS_PLUGIN / MODULE_MISSING_EXPORTS / MODULE_FILE_NOT_FOUND) as structured failures, which then flow to the frontend through the existing OBS_API_getModuleLoadFailures (#1733) with no OSN-side change. The startup crash guard remains in #1736. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a positive capability check after module load that verifies the OBS plugins we depend on are actually registered, and surfaces any gaps through the structured
moduleLoadFailureslist introduced in #1733 (read byOBS_API_getModuleLoadFailures).Motivation
#1733 / obs-studio #741 expose structured module load failures, but libobs only records a failure for
MODULE_ERROR,MODULE_INCOMPATIBLE_VER, and modules that load-but-decline. The two states that actually break us are skipped silently:MODULE_FILE_NOT_FOUND— the plugin DLL is missing on disk (e.g.obs-ffmpeg.dll)MODULE_MISSING_EXPORTS— the DLL fails to expose its OBS exportsIn both cases
load_all_callbackjustreturn;s, so the module never appears inmfi.failures. A frontend reading only the failure list therefore sees nothing — even though a core encoder is gone.This is the condition behind a class of startup crashes: with
obs-ffmpeg.dllabsent, theffmpeg_aacencoder isn't registered, and recording-audio-encoder setup dereferenced the null codec (strlen(NULL)AV inOBS_API_initAPI). The crash itself is fixed separately in #1736; this PR makes the underlying missing-plugin condition visible to the frontend.What it does
After
obs_post_load_modules(),reportMissingEssentialModules()checks registration of:ffmpeg_aacobs_get_encoder_codecobs_x264obs_get_encoder_codecrtmp_outputobs_get_output_flagsrtmp_commonobs_enum_service_typesAny missing one is logged and appended to
moduleLoadFailureswith codeESSENTIAL_MODULE_MISSING(deduped against entries libobs already reported). Init is not aborted.How Has This Been Tested?
obs-studio-server-lib(Release, VS 2022) compiles cleanly against the Update libobs to v25.20.20 #741obs_module_failure_info(verified locally by adding the struct to the prebuilt header; the build tree's cached libobs is31.1.2sl6, so CI on the31.1.2ndi1package is authoritative).clang-format18.1.3--dry-run -Werroron the added lines: clean.Types of changes
🤖 Generated with Claude Code