REF-038 - Harden Optional MediaInfo DLL Loading And Metadata Extraction Seams¶
Summary¶
Harden the existing optional MediaInfo.dll metadata path without changing the
release dependency posture. MediaInfo.dll remains an external optional runtime
DLL, built-in RIFF/RM/WM probes remain fallback paths, and id3lib remains the
explicit MPEG-audio fallback.
This is release hardening, not a feature expansion and not a dependency replacement.
Current State¶
srchybrid/MediaInfo_DLL.cppowns the runtime loader for the optionalMediaInfo.dll.srchybrid/FileInfoDialog.cppuses the MediaInfo path for the File Info dialog, withInspectAllFileTypesbroadening inspection beyond audio/video.srchybrid/KnownFile.cppuses the MediaInfo path for shared-file metadata tags whenExtractMetaDatais enabled and the file is audio/video.- Hidden profile keys still control the legacy fallback switches:
MediaInfo_RIFF,MediaInfo_RM,MediaInfo_WM,MediaInfo_MediaDet,MediaInfo_ID3LIB, andMediaInfo_MediaInfoDllPath.
Intended Scope¶
- Serialize first-use DLL initialization so background File Info inspection and shared-file metadata extraction cannot race the global loader.
- Load accepted DLL candidates with an explicit path and safe DLL search flags.
- Treat a
MediaInfo_Openresult of0as an open failure and release the created MediaInfo handle immediately. - Keep one-close ownership around MediaInfo handles through local RAII.
- Add testable seams for the minimum loader rules: no-load marker, version gate, candidate de-duplication, app-relative configured paths, and open-result handling.
- Document the hidden profile-only MediaInfo keys in the preference matrix.
Out Of Scope¶
- Embedding or statically linking MediaInfoLib.
- Removing or replacing
id3lib. - Changing
BUG-028from Wont-Fix. - Implementing the Windows Property Store work tracked separately by
FEAT-007. - Broad
CGetMediaInfoThreadmessaging or cancellation rewrites.
Acceptance¶
- [x] Loader initialization is guarded by a synchronization primitive.
- [x] Loader uses explicit-path
LoadLibraryExwith safe DLL search flags. - [x]
MediaInfo_Open == 0produces no metadata result and does not leak the created handle. - [x] Existing metadata precedence is unchanged.
- [x] Native seam tests cover the loader policy helpers.
- [x] Workspace validation and the relevant native test target pass through
python -m emule_workspace.