Giter Site home page Giter Site logo

Can No Longer Play DVD Isos about mpv.net HOT 2 OPEN

DReaper avatar DReaper commented on June 16, 2024
Can No Longer Play DVD Isos

from mpv.net.

Comments (2)

DReaper avatar DReaper commented on June 16, 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.

from mpv.net.

Sneakpeakcss avatar Sneakpeakcss commented on June 16, 2024

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.

from mpv.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.