From 00bfa20facec03e2102d0022bc95f6c38c885e38 Mon Sep 17 00:00:00 2001 From: stax76 Date: Mon, 8 Aug 2022 03:19:11 +0200 Subject: [PATCH] improved OSD media info --- src/Misc/Commands.cs | 2 +- src/Misc/Player.cs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Misc/Commands.cs b/src/Misc/Commands.cs index 0cf0809..9006ccb 100644 --- a/src/Misc/Commands.cs +++ b/src/Misc/Commands.cs @@ -435,7 +435,7 @@ namespace mpvnet if (editor) ShowTextWithEditor("media-info", text); else if (osd) - ShowText(text.Replace("\r", ""), 5000, 17); + ShowText(text.Replace("\r", ""), 5000, 16); else { MsgBoxEx.MessageBoxEx.MsgFontFamily = new FontFamily("Consolas"); diff --git a/src/Misc/Player.cs b/src/Misc/Player.cs index da559c2..e1b7269 100644 --- a/src/Misc/Player.cs +++ b/src/Misc/Player.cs @@ -1658,7 +1658,6 @@ namespace mpvnet Add(track, mi.GetVideo(i, "BitRate/String")); Add(track, fps + " FPS"); Add(track, (videoCount > 1 && mi.GetVideo(i, "Default") == "Yes") ? "Default" : ""); - Add(track, mi.GetVideo(i, "Title")); track.Text = "V: " + track.Text.Trim(' ', ','); track.Type = "v"; track.ID = i + 1; @@ -1709,12 +1708,18 @@ namespace mpvnet if (title.ContainsEx("Stereo")) title = title.Replace("Stereo", ""); - if (title.StartsWith(format + " ")) + if (title.StartsWithEx(format + " ")) title = title.Replace(format + " ", ""); foreach (string i2 in new [] { "2.0", "5.1", "6.1", "7.1" }) if (title.ContainsEx(i2)) - title = title.Replace(i2, ""); + title = title.Replace(i2, "").Trim(); + + if (title.ContainsEx("@ ")) + title = title.Replace("@ ", ""); + + if (title.ContainsEx(" @")) + title = title.Replace(" @", ""); if (title.ContainsEx("()")) title = title.Replace("()", "");