From 7c38e823c120f83cbd20fa487bafd726bd843e68 Mon Sep 17 00:00:00 2001 From: stax76 Date: Wed, 17 Jul 2024 02:44:48 +0200 Subject: [PATCH] fix #676 --- docs/changelog.md | 5 +++-- src/MpvNet.Windows/WPF/WpfTranslator.cs | 1 - src/MpvNet/MpvNet.csproj | 2 -- src/MpvNet/Player.cs | 24 ++++++++++++++++++------ 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 92f0dc5..be3d9e1 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,11 +3,12 @@ - Korean, Russian and Turkish translation added, Japanese translation fixed. Thanks to the translation team! - Action/Workflow/Auto build fix and update. -- Full support for select.lua which is a new simple command palette script embedded into mpv/libmpv. - In the context menu select.lua features can be found under 'View > On Screen Menu'. +- New default bindings and menu items for select.lua which is a new simple mpv built-in command palette script. + In the context menu select.lua features can be found under `View > On Screen Menu`. https://github.com/mpv-player/mpv/blob/master/player/lua/select.lua - The helper script 'Tools\update-mpv-and-libmpv.ps1' no longer uses command line arguments, it uses now the Path environment variable to find mpv and mpv.net. +- Fix loading of DVD ISO files. # v7.1.1.0 (2024-02-03) diff --git a/src/MpvNet.Windows/WPF/WpfTranslator.cs b/src/MpvNet.Windows/WPF/WpfTranslator.cs index 1a9b194..7181195 100644 --- a/src/MpvNet.Windows/WPF/WpfTranslator.cs +++ b/src/MpvNet.Windows/WPF/WpfTranslator.cs @@ -2,7 +2,6 @@ using NGettext.Wpf; using System.Globalization; -using System.Windows.Interop; namespace MpvNet.Windows.WPF; diff --git a/src/MpvNet/MpvNet.csproj b/src/MpvNet/MpvNet.csproj index 88bef24..6eaa0ea 100644 --- a/src/MpvNet/MpvNet.csproj +++ b/src/MpvNet/MpvNet.csproj @@ -16,8 +16,6 @@ - - diff --git a/src/MpvNet/Player.cs b/src/MpvNet/Player.cs index 817bc54..5668bb2 100644 --- a/src/MpvNet/Player.cs +++ b/src/MpvNet/Player.cs @@ -453,7 +453,7 @@ public class MainPlayer : MpvClient } if (ext == "iso") - LoadBluRayISO(file); + LoadISO(file); else if(FileTypes.Subtitle.Contains(ext)) CommandV("sub-add", file); else if (!FileTypes.IsMedia(ext) && !file.Contains("://") && Directory.Exists(file) && @@ -488,12 +488,24 @@ public class MainPlayer : MpvClient return path; } - public void LoadBluRayISO(string path) + public void LoadISO(string path) { - Command("stop"); - Thread.Sleep(500); - SetPropertyString("bluray-device", path); - LoadFiles(new[] { @"bd://" }, false, false); + using var mi = new MediaInfo(path); + + if (mi.GetGeneral("Format") == "ISO 9660 / DVD Video") + { + Command("stop"); + Thread.Sleep(500); + SetPropertyString("dvd-device", path); + LoadFiles(new[] { @"dvd://" }, false, false); + } + else + { + Command("stop"); + Thread.Sleep(500); + SetPropertyString("bluray-device", path); + LoadFiles(new[] { @"bd://" }, false, false); + } } public void LoadDiskFolder(string path)