From f96d76d62fc854fc3d605703a1528619eab9ca5a Mon Sep 17 00:00:00 2001 From: nilaoda Date: Tue, 29 Nov 2022 10:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=9D=9E=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4=E7=9A=84=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs b/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs index 936f48d..427da8d 100644 --- a/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs +++ b/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs @@ -90,6 +90,12 @@ namespace Mp4SubtitleParser { var _begin = _p.GetAttribute("begin"); var _end = _p.GetAttribute("end"); + //Handle namespace + foreach (XmlAttribute attr in _p.Attributes) + { + if (attr.LocalName == "begin") _begin = attr.Value; + else if (attr.LocalName == "end") _end = attr.Value; + } _p.SetAttribute("begin", Add(_begin)); _p.SetAttribute("end", Add(_end)); //Console.WriteLine($"{_begin} {_p.GetAttribute("begin")}"); @@ -278,6 +284,13 @@ namespace Mp4SubtitleParser var _end = _p.GetAttribute("end"); var _region = _p.GetAttribute("region"); var _bgImg = _p.GetAttribute("smpte:backgroundImage"); + //Handle namespace + foreach (XmlAttribute attr in _p.Attributes) + { + if (attr.LocalName == "begin") _begin = attr.Value; + else if (attr.LocalName == "end") _end = attr.Value; + else if (attr.LocalName == "region") _region = attr.Value; + } var sub = new SubEntity { Begin = _begin,