Fix Windows libmpv search paths - #20
Conversation
|
@Blackspirits Thanks for sending me some feedback. Unfortunately, I hit an error while trying to use the custom Copilot setup steps configured for this repository. The error I am seeing is: Once you or someone with the necessary access fixes the problem, please let me know in a comment and I'll try again. Thanks! |
There was a problem hiding this comment.
🟡 Changes recommended
Normalize equivalent Windows directory paths to prevent duplicate probing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes Windows libmpv discovery by prioritizing user data and application directories, with regression coverage.
Changes:
- Defines ordered Windows search paths with fallback handling.
- Adds path de-duplication.
- Adds focused ordering and de-duplication tests.
File summaries
| File | Summary |
|---|---|
tests/UI/Logic/VideoPlayers/LibMpvLibraryPathTests.cs |
Tests search ordering and de-duplication. |
src/ui/Logic/VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs |
Implements Windows search paths; equivalent roots are not fully normalized before comparison. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@Blackspirits Thanks for sending me some feedback. Unfortunately, I hit an error while trying to use the custom Copilot setup steps configured for this repository. The error I am seeing is: Once you or someone with the necessary access fixes the problem, please let me know in a comment and I'll try again. Thanks! |
There was a problem hiding this comment.
🔵 Needs a closer look
The default loader-path fallback and Windows root de-duplication still need correction.
Review details
Suppressed comments (2)
src/ui/Logic/VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs:394
- Adding
string.Emptyhere does not make the default Windows loader path reachable:LoadLibraryInternalfirst requiresFile.Exists(fullPath), and for this entryfullPathis justlibmpv-2.dll, whichFile.Existschecks only in the current directory rather than PATH/system loader directories. A DLL available only through the Windows loader search path will therefore still be skipped; handle the empty-root candidate without that precheck (or resolve the loader path explicitly).
}
src/ui/Logic/VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs:379
- This compares raw strings, so it does not actually de-duplicate equivalent Windows roots such as
C:\appvsC:\app\(or slash variants).AppContext.BaseDirectorycommonly has a trailing separator whileDirectory.GetCurrentDirectory()does not, so a portable run can probe the same directory twice; normalize non-empty roots before comparing while keepingstring.Emptyas the distinct default-loader entry.
{
if (string.IsNullOrEmpty(path))
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
@Blackspirits Thanks for sending me some feedback. Unfortunately, I hit an error while trying to use the custom Copilot setup steps configured for this repository. The error I am seeing is: Once you or someone with the necessary access fixes the problem, please let me know in a comment and I'll try again. Thanks! |
Summary
On Windows the libmpv loader currently searches the manual override, current working directory, and the default loader path. The installer stores libmpv under the per-user data folder, so lookup should not depend on the process working directory.
This change makes the Windows order explicit:
It also de-duplicates equivalent roots and adds focused regression coverage.
Validation
AI assistance: ChatGPT was used to audit Windows library discovery and prepare the regression-tested fix.