[SCM] kodi-pvr-hts/master: [pvr.hts] remove horrible find_if() search and replace with provided data

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Sat Jan 7 11:27:56 UTC 2017


The following commit has been merged in the master branch:
commit a00b5ef37c95c8e542578932310c80fdfd8bd298
Author: Adam Sutton <dev at adamsutton.me.uk>
Date:   Tue Nov 22 22:59:43 2016 +0000

    [pvr.hts] remove horrible find_if() search and replace with provided data
    
    Since HTSPv6 it turns out we're provided with the ID of any matching DVR
    entry. So rather than using a horribly inefficient search algo (especially
    when 99.99% of the time there won't be a match) we'll just use the data
    provided.
    
    We no longer support anything less than HTSPv10, so no need for a protocol
    version check.

diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
index 86c7018..daf1541 100644
--- a/src/Tvheadend.cpp
+++ b/src/Tvheadend.cpp
@@ -2217,16 +2217,8 @@ bool CTvheadend::ParseEvent ( htsmsg_t *msg, bool bAdd, Event &evt )
     evt.SetPart(u32);
 
   /* Add optional recording link */
-  auto rit = std::find_if(
-    m_recordings.cbegin(), 
-    m_recordings.cend(), 
-    [evt](const RecordingMapEntry &entry)
-  {
-    return entry.second.GetEventId() == evt.GetId();
-  });
-
-  if (rit != m_recordings.cend())
-    evt.SetRecordingId(evt.GetId());
+  if (!htsmsg_get_u32(msg, "dvrId", &u32))
+    evt.SetRecordingId(u32);
   
   return true;
 }

-- 
kodi-pvr-hts packaging



More information about the pkg-multimedia-commits mailing list