libobs: Rename MODULE_FILE_NOT_FOUND code to MODULE_FAILED_TO_OPEN

This code is returned if os_dlopen returns NULL. This can happen for
multiple reasons, not just because the file can't be found. Since [1]
other causes are getting more common, but this could also happen before.

[1]: 62429135ba
This commit is contained in:
Sebastian Beckmann
2025-09-04 20:27:59 +02:00
committed by Ryan Foster
parent 9a3fe95211
commit fd214a9c6e
3 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -28,7 +28,8 @@
#define MODULE_SUCCESS 0
#define MODULE_ERROR -1
#define MODULE_FILE_NOT_FOUND -2
#define MODULE_FAILED_TO_OPEN -2
#define MODULE_FILE_NOT_FOUND MODULE_FAILED_TO_OPEN /* DEPRECATED! */
#define MODULE_MISSING_EXPORTS -3
#define MODULE_INCOMPATIBLE_VER -4
#define MODULE_HARDCODED_SKIP -5
+3 -3
View File
@@ -160,7 +160,7 @@ int obs_open_module(obs_module_t **module, const char *path, const char *data_pa
mod.module = os_dlopen(path);
if (!mod.module) {
blog(LOG_WARNING, "Module '%s' not loaded", path);
return MODULE_FILE_NOT_FOUND;
return MODULE_FAILED_TO_OPEN;
}
errorcode = load_module_exports(&mod, path);
@@ -522,8 +522,8 @@ static void load_all_callback(void *param, const struct obs_module_info2 *info)
case MODULE_MISSING_EXPORTS:
blog(LOG_DEBUG, "Failed to load module file '%s', not an OBS plugin", info->bin_path);
return;
case MODULE_FILE_NOT_FOUND:
blog(LOG_DEBUG, "Failed to load module file '%s', file not found", info->bin_path);
case MODULE_FAILED_TO_OPEN:
blog(LOG_DEBUG, "Failed to load module file '%s', module failed to open", info->bin_path);
return;
case MODULE_ERROR:
blog(LOG_DEBUG, "Failed to load module file '%s'", info->bin_path);
+1 -1
View File
@@ -482,7 +482,7 @@ EXPORT bool obs_get_audio_info2(struct obs_audio_info2 *oai2);
* data files are stored.
* @returns MODULE_SUCCESS if successful
* MODULE_ERROR if a generic error occurred
* MODULE_FILE_NOT_FOUND if the module was not found
* MODULE_FAILED_TO_OPEN if the module failed to open, e.g. because it was not found or had missing symbols
* MODULE_MISSING_EXPORTS if required exports are missing
* MODULE_INCOMPATIBLE_VER if incompatible version
*/