Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open any folders #4711

Closed
qwertea opened this issue Aug 4, 2017 · 9 comments
Closed

Cannot open any folders #4711

qwertea opened this issue Aug 4, 2017 · 9 comments

Comments

@qwertea
Copy link

qwertea commented Aug 4, 2017

mpv version and platform

mpv 0.26.0-46-gdf12f76910
Windows 10, 64-bit

Reproduction steps

Drag a folder onto the mpv window, or open a folder from the command line.

Expected behavior

mpv plays all video files in the folder.

Actual behavior

mpv closes.

Log file

https://pastebin.com/raw/1UHMUh1y

It says permission denied but the same thing happens even if I run mpv as admin. The folders are entirely accessible to my account and if I open the actual videos inside the folders in mpv, they play just fine.

@Skibicki
Copy link

Skibicki commented Aug 4, 2017

This is normal. Use 'mpv *' or the Autoload script.
https://github.com/mpv-player/mpv/wiki/User-Scripts

@qwertea
Copy link
Author

qwertea commented Aug 4, 2017

Well I've read many times on different places on the internet that you can drag a folder onto the mpv window and it'll automatically enqueue all the files in it. Is that a unix specific thing then? Well if this is normal behavior then I'll close the issue, apologies.

@qwertea qwertea closed this as completed Aug 4, 2017
@garoto
Copy link
Contributor

garoto commented Aug 4, 2017

A directory context menu like "play in mpv" as well as a directory menu background entrie can be used as a workaround. I have a .reg file with the commands if you're interested.

@qwertea
Copy link
Author

qwertea commented Aug 4, 2017

I am. Please post it.

@garoto
Copy link
Contributor

garoto commented Aug 4, 2017

Copy the block below into a text editor replacing "C:\\Apps\\AV\\mpv\\mpv.exe\" with your own mpv.exe full path, save as a .reg file and merge. Hopefully it'll work as intended

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\background\shell\mpv]
@="Play all with mpv"

[HKEY_CLASSES_ROOT\Directory\background\shell\mpv\command]
@="\"C:\\Apps\\AV\\mpv\\mpv.exe\" \"%V\\*\""

[HKEY_CLASSES_ROOT\Directory\shell\mpv]
@="Play all with mpv"

[HKEY_CLASSES_ROOT\Directory\shell\mpv\command]
@="\"C:\\Apps\\AV\\mpv\\mpv.exe\" \"%L\\*\""

@qwertea
Copy link
Author

qwertea commented Aug 4, 2017

It works. Shift+Q to save which file you were on works as well. Thanks!

@haasn
Copy link
Member

haasn commented Aug 4, 2017

What exactly is normal about being unable to play a directory on windows?! That seems like a bug to me

@rossy
Copy link
Member

rossy commented Aug 4, 2017

Yeah, agreed. This works in Linux, and it only doesn't work in Windows because of an API/CRT quirk where you have to pass a special flag to open directories. This should probably be fixed.

@rossy rossy reopened this Aug 4, 2017
@haasn
Copy link
Member

haasn commented Aug 4, 2017

I wonder if we can use the unix subsystem on windows to open files using normal POSIX syscalls that work.

rossy added a commit to rossy/mpv that referenced this issue Oct 24, 2017
Directory-opening never worked on Windows because MSVCRT's open()
doesn't open directories and its fstat() doesn't recognise directory
handles. These are just MSVCRT restrictions, and the Windows API itself
has no problem with opening directories as file objects, so reimplement
mpv's mp_open and mp_stat to use the Windows API directly. This should
fix directory playback.

This also populates the st_dev and st_ino fields of struct stat, so
filesystem loop checking in demux_playlist.c should now work on Windows.

Fixes mpv-player#4711
rossy added a commit to rossy/mpv that referenced this issue Oct 24, 2017
Directory-opening never worked on Windows because MSVCRT's open()
doesn't open directories and its fstat() doesn't recognise directory
handles. These are just MSVCRT restrictions, and the Windows API itself
has no problem with opening directories as file objects, so reimplement
mpv's mp_open and mp_stat to use the Windows API directly. This should
fix directory playback.

This also populates the st_dev and st_ino fields of struct stat, so
filesystem loop checking in demux_playlist.c should now work on Windows.

Fixes mpv-player#4711
rossy added a commit to rossy/mpv that referenced this issue Oct 24, 2017
Directory-opening never worked on Windows because MSVCRT's open()
doesn't open directories and its fstat() doesn't recognise directory
handles. These are just MSVCRT restrictions, and the Windows API itself
has no problem with opening directories as file objects, so reimplement
mpv's mp_open and mp_stat to use the Windows API directly. This should
fix directory playback.

This also populates the st_dev and st_ino fields of struct stat, so
filesystem loop checking in demux_playlist.c should now work on Windows.

Fixes mpv-player#4711
rossy added a commit to rossy/mpv that referenced this issue Oct 25, 2017
Directory-opening never worked on Windows because MSVCRT's open()
doesn't open directories and its fstat() doesn't recognise directory
handles. These are just MSVCRT restrictions, and the Windows API itself
has no problem with opening directories as file objects, so reimplement
mpv's mp_open and mp_stat to use the Windows API directly. This should
fix directory playback.

This also populates the st_dev and st_ino fields of struct stat, so
filesystem loop checking in demux_playlist.c should now work on Windows.

Fixes mpv-player#4711
rossy added a commit to rossy/mpv that referenced this issue Oct 25, 2017
Directory-opening never worked on Windows because MSVCRT's open()
doesn't open directories and its fstat() doesn't recognise directory
handles. These are just MSVCRT restrictions, and the Windows API itself
has no problem with opening directories as file objects, so reimplement
mpv's mp_open and mp_stat to use the Windows API directly. This should
fix directory playback.

This also populates the st_dev and st_ino fields of struct stat, so
filesystem loop checking in demux_playlist.c should now work on Windows.

Fixes mpv-player#4711
rossy added a commit to rossy/mpv that referenced this issue Oct 25, 2017
Directory-opening never worked on Windows because MSVCRT's open()
doesn't open directories and its fstat() doesn't recognise directory
handles. These are just MSVCRT restrictions, and the Windows API itself
has no problem with opening directories as file objects, so reimplement
mpv's mp_open and mp_stat to use the Windows API directly. This should
fix directory playback.

This also populates the st_dev and st_ino fields of struct stat, so
filesystem loop checking in demux_playlist.c should now work on Windows.

Fixes mpv-player#4711
@rossy rossy closed this as completed in 257a2b9 Oct 25, 2017
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

No branches or pull requests

5 participants