diff options
author | Miguel Borges de Freitas <92enen@gmail.com> | 2023-12-05 22:54:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 22:54:27 +0000 |
commit | 7fe30ded8ebb1c838955e647794a8f34e244f254 (patch) | |
tree | 92c3fe27d71d89cfeeca29f99136836188412201 | |
parent | 576474785608b5df7069381fd8be6edc914c0d67 (diff) | |
parent | a633fed5361a92002941902a903bb207b0cff414 (diff) |
Merge pull request #24185 from enen92/tinyxml2_edl
[EDL] Migrate to tinyxml2
-rw-r--r-- | xbmc/cores/VideoPlayer/Edl.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/xbmc/cores/VideoPlayer/Edl.cpp b/xbmc/cores/VideoPlayer/Edl.cpp index a3bbea05ad..01c7ed09b1 100644 --- a/xbmc/cores/VideoPlayer/Edl.cpp +++ b/xbmc/cores/VideoPlayer/Edl.cpp @@ -17,7 +17,7 @@ #include "settings/SettingsComponent.h" #include "utils/StringUtils.h" #include "utils/URIUtils.h" -#include "utils/XBMCTinyXML.h" +#include "utils/XBMCTinyXML2.h" #include "utils/log.h" #include "PlatformDefs.h" @@ -482,36 +482,36 @@ bool CEdl::ReadBeyondTV(const std::string& strMovie) if (!CFile::Exists(beyondTVFilename)) return false; - CXBMCTinyXML xmlDoc; + CXBMCTinyXML2 xmlDoc; if (!xmlDoc.LoadFile(beyondTVFilename)) { CLog::Log(LOGERROR, "{} - Could not load Beyond TV file: {}. {}", __FUNCTION__, - CURL::GetRedacted(beyondTVFilename), xmlDoc.ErrorDesc()); + CURL::GetRedacted(beyondTVFilename), xmlDoc.ErrorStr()); return false; } if (xmlDoc.Error()) { CLog::Log(LOGERROR, "{} - Could not parse Beyond TV file: {}. {}", __FUNCTION__, - CURL::GetRedacted(beyondTVFilename), xmlDoc.ErrorDesc()); + CURL::GetRedacted(beyondTVFilename), xmlDoc.ErrorStr()); return false; } - TiXmlElement *pRoot = xmlDoc.RootElement(); - if (!pRoot || strcmp(pRoot->Value(), "cutlist")) + const tinyxml2::XMLElement* root = xmlDoc.RootElement(); + if (!root || strcmp(root->Value(), "cutlist")) { CLog::Log(LOGERROR, "{} - Invalid Beyond TV file: {}. Expected root node to be <cutlist>", __FUNCTION__, CURL::GetRedacted(beyondTVFilename)); return false; } - bool bValid = true; - TiXmlElement *pRegion = pRoot->FirstChildElement("Region"); - while (bValid && pRegion) + bool valid = true; + const tinyxml2::XMLElement* region = root->FirstChildElement("Region"); + while (valid && region) { - TiXmlElement *pStart = pRegion->FirstChildElement("start"); - TiXmlElement *pEnd = pRegion->FirstChildElement("end"); - if (pStart && pEnd && pStart->FirstChild() && pEnd->FirstChild()) + const tinyxml2::XMLElement* start = region->FirstChildElement("start"); + const tinyxml2::XMLElement* end = region->FirstChildElement("end"); + if (start && end && start->FirstChild() && end->FirstChild()) { /* * Need to divide the start and end times by a factor of 10,000 to get msec. @@ -526,17 +526,17 @@ bool CEdl::ReadBeyondTV(const std::string& strMovie) * atof() returns 0 if there were any problems and will subsequently be rejected in AddEdit(). */ Edit edit; - edit.start = std::lround((std::atof(pStart->FirstChild()->Value()) / 10000)); - edit.end = std::lround((std::atof(pEnd->FirstChild()->Value()) / 10000)); + edit.start = std::lround((std::atof(start->FirstChild()->Value()) / 10000)); + edit.end = std::lround((std::atof(end->FirstChild()->Value()) / 10000)); edit.action = Action::COMM_BREAK; - bValid = AddEdit(edit); + valid = AddEdit(edit); } else - bValid = false; + valid = false; - pRegion = pRegion->NextSiblingElement("Region"); + region = region->NextSiblingElement("Region"); } - if (!bValid) + if (!valid) { CLog::Log(LOGERROR, "{} - Invalid Beyond TV file: {}. Clearing any valid commercial breaks found.", |