mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.32k stars 2.9k forks source link

Emit an error if a long path is encountered but Windows long path support is not turned on in the Registry #13155

Open cheater opened 10 months ago

cheater commented 10 months ago

Important Information

Provide following Information:

If you're not using git master or the latest release, update. Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

Try to reproduce your issue with --no-config first. If it isn't reproducible with --no-config try to first find out which option or script causes your issue.

Describe the reproduction steps as precise as possible. It's very likely that the bug you experience wasn't reproduced by the developer because the workflow differs from your own.

Create folder called C:\a and put a file called x.mp4 in there. Then, rename the file in Windows Explorer to make the name as long as possible (just hold x until Windows starts beeping). Then, go up and rename the folder so the name is as long as possible.

Open the file in mpv. mpv should be able to play the file.

Turn off Windows long path support according to this article:

Either delete the key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled or set it to 0.

Reboot

Open the file in mpv

mpv will be unable to open the file

No error explaining why the file hasn't been able to opened is shown in the log.

Expected behavior

Check the path length and on paths that are too long emit an error that instructs the user to enable Long Path Support in the Registry and directing them to this URL: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

Possibly include the PowerShell command so people can just copy-paste it into PowerShell. Alternatively tell people to create a .reg file and double-click it.

See discussion here: https://github.com/mpv-player/mpv/pull/13134

Actual behavior

No error is provided.

Log file

Make a log file made with -v -v or --log-file=output.txt, attach it to the issue, and replace this text with a link to it.

Without the log file, this issue will be closed for ignoring the issue template.

In the case of a crash, please provide a backtrace.

N/A

Sample files

Sample files needed to reproduce this issue can be attached to the issue (preferred), or be uploaded to https://0x0.st/ or similar sites. (Only needed if the issue cannot be reproduced without it.) Do not use garbage like "cloud storage", especially not Google Drive.

N/A

Andarwinux commented 10 months ago

https://github.com/shinchiro/mpv-packaging/commit/1c534ce8c21fab0be2a394ad73decc15e015693e

cheater commented 10 months ago

indeed I saw your contribution to mpv-packaging, but the mpv builds here can be used without installers.