Skip to content

Commit

Permalink
Kodi EDL limit (#175)
Browse files Browse the repository at this point in the history
Kodi PVR only allows 32 EDL entries.

Co-authored-by: emveepee <nospam>
  • Loading branch information
emveepee authored Jul 30, 2021
1 parent 9d94dde commit d6063ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pvr.nextpvr/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.nextpvr"
version="8.2.5"
version="8.2.6"
name="NextPVR PVR Client"
provider-name="Graeme Blackley">
<requires>@ADDON_DEPENDS@
Expand Down
3 changes: 3 additions & 0 deletions pvr.nextpvr/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v8.2.6
- Kodi has a limit of 32 EDL breaks in PVR

v8.2.5
- Update timer from a recurring recording
- Remove extra parameter on log call
Expand Down
11 changes: 10 additions & 1 deletion src/Recordings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,20 @@ PVR_ERROR Recordings::GetRecordingEdl(const kodi::addon::PVRRecording& recording
tinyxml2::XMLDocument doc;
if (m_request.DoMethodRequest(request, doc) == tinyxml2::XML_SUCCESS)
{
int index = 0;
int numEDL = 0;
tinyxml2::XMLNode* commercialsNode = doc.RootElement()->FirstChildElement("commercials");
tinyxml2::XMLNode* pCommercialNode;
for (pCommercialNode = commercialsNode->FirstChildElement("commercial"); pCommercialNode; pCommercialNode = pCommercialNode->NextSiblingElement())
{
if (numEDL++ == PVR_ADDON_EDL_LENGTH)
{
/* PVR core stores EDL breaks in a hard-coded array in PVRClient.cpp PVR_EDL_ENTRY edl_array[PVR_ADDON_EDL_LENGTH];
* currently https://github.com/xbmc/xbmc/blob/master/xbmc/pvr/addons/PVRClient.cpp#L1056
* This check avoids overflowing this arrray */

kodi::Log(ADDON_LOG_WARNING, "Maximum EDL entries reached");
break;
}
kodi::addon::PVREDLEntry entry;
std::string buffer;
XMLUtils::GetString(pCommercialNode, "start", buffer);
Expand Down

0 comments on commit d6063ca

Please sign in to comment.