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

Can No Longer Play DVD Isos #676

Open
DReaper opened this issue Apr 5, 2024 · 2 comments
Open

Can No Longer Play DVD Isos #676

DReaper opened this issue Apr 5, 2024 · 2 comments
Assignees
Labels

Comments

@DReaper
Copy link

DReaper commented Apr 5, 2024

Describe the bug
When playing a DVD .iso, it attempts to read it as a Blu-Ray, then fails to read. DVD playback has worked in older versions. I updated from 6.0.3.0, which worked. I am unsure if this broke in recent versions.

To Reproduce
Click and drag any DVD .iso over to the player

Expected behavior
In previous versions, a pop-up would ask whether it was a DVD or Blu-Ray. Selecting DVD would playback with no issues. This feature was implemented in 5.4.8.4 Beta

Additional context
No issues with Blu-Ray playback, only DVDs.

@DReaper
Copy link
Author

DReaper commented Apr 5, 2024

To note, this issue is happening on the latest 7.1.1.0 version.

If I mount the iso file outside of mpv.net and open it through Open DVD/Blu-Ray Drive/Folder, it will playback fine. The issue is only if you attempt to direct play a DVD iso.

@Sneakpeakcss
Copy link
Collaborator

Looks like DVD iso handling was removed in newest version for some reason:

public void LoadBluRayISO(string path)
{
Command("stop");
Thread.Sleep(500);
SetPropertyString("bluray-device", path);
LoadFiles(new[] { @"bd://" }, false, false);
}

older mpv.net handled this differently:

mpv.net/src/Misc/Player.cs

Lines 1246 to 1271 in dbf1a32

public void LoadISO(string path)
{
long gb = new FileInfo(path).Length / 1024 / 1024 / 1024;
if (gb < 10)
{
System.Windows.MessageBoxResult result =
Msg.ShowQuestion("Click Yes for Blu-ray and No for DVD.",
System.Windows.MessageBoxButton.YesNoCancel);
switch (result)
{
case System.Windows.MessageBoxResult.Yes:
Command("stop");
Thread.Sleep(500);
SetPropertyString("bluray-device", path);
LoadFiles(new[] { @"bd://" }, false, false);
break;
case System.Windows.MessageBoxResult.No:
Command("stop");
Thread.Sleep(500);
SetPropertyString("dvd-device", path);
LoadFiles(new[] { @"dvd://" }, false, false);
break;
}
}

And unfortunately you can't use a lua script to handle this:

local function check_iso()
    local path = mp.get_property("path")
    local extension = string.match(path, "%.([^%.]+)$")
    local extension = extension and extension:lower()

    if extension == "iso" then
        mp.register_event("end-file", function(event)
            if event.reason == "error" then
                if mp.get_property("bluray-device") == path then
                    mp.set_property("bluray-device", "")
                    mp.set_property("dvd-device", path)
                    mp.commandv("loadfile", "dvd://")
                end
            elseif mp.get_property("dvd-device") == path then
                mp.set_property("dvd-device", "")
            end
            mp.unregister_event("end-file")
        end)

        mp.set_property("bluray-device", path)
        mp.commandv("loadfile", "bd://")
        iso_loaded=true
    end
end

mp.register_event("file-loaded", check_iso)

mp.register_event("end-file", function(event)
    if mp.get_property_bool("idle-active") then
        if iso_loaded and (event.reason == "eof" or event.reason == "stop") then
             mp.set_property("bluray-device", "")
             mp.set_property("dvd-device", "")
             iso_loaded=false
        end
    end
end)

because mpv.net hijacks the iso loading instantly and the script never executes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants