Skip to content

Fix long path loading issue (#735)#741

Closed
magnetProgramming wants to merge 1 commit intompvnet-player:mainfrom
magnetProgramming:fix-long-path-issue
Closed

Fix long path loading issue (#735)#741
magnetProgramming wants to merge 1 commit intompvnet-player:mainfrom
magnetProgramming:fix-long-path-issue

Conversation

@magnetProgramming
Copy link

Fix: Support for long file paths on Windows (#735)
This fixes the issue where mpvnet.exe wouldn’t open files with really long paths when launched from the command line or another program.

I updated the ConvertFilePath method to add the \?\ prefix to long Windows paths. That way, it can handle paths over 260 characters just like mpv.exe does.

Tested with short and long filenames and everything seems to work fine. Let me know if I should change anything. This is my first contribution so sorry if I messed up something.

@aircooledjacob
Copy link

aircooledjacob commented Aug 5, 2025

I would note that while \?\C:\Users\user\videos\video.mkv is correct for a local drive (C, D, etc.) I believe windows expects slightly different for network shares / UNC Paths.
e.g. i believe \myserver\myshare\video.mkv would need to become \?\UNC\myserver\myshare\video.mkv

@stax76
Copy link
Collaborator

stax76 commented Aug 9, 2025

I think the proper fix is enabling long paths in windows.

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

@stax76 stax76 closed this Oct 4, 2025
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.

3 participants