Ticket #494: eitcrawl-num-events-added.diff
File eitcrawl-num-events-added.diff, 2.6 KB (added by , 20 years ago) |
---|
-
libs/libmythtv/eithelper.cpp
old new 65 65 eitList.pop_front(); 66 66 67 67 eitList_lock.unlock(); 68 UpdateEITList(mplexid, *events);68 eitCount += UpdateEITList(mplexid, *events); 69 69 QList_Events::iterator it = events->begin(); 70 70 for (; it != events->end(); ++it) 71 71 delete *it; 72 72 delete events; 73 73 eitList_lock.lock(); 74 if (eitCount != 0) 75 { 76 VERBOSE(VB_IMPORTANT, QString ("EITHelper: Added %1 events") 77 .arg(eitCount)); 78 } 79 eitCount = 0; 74 80 } 75 81 else 76 82 { … … 83 89 events->erase(events->begin(), subset_end); 84 90 85 91 eitList_lock.unlock(); 86 UpdateEITList(mplexid, subset);92 eitCount += UpdateEITList(mplexid, subset); 87 93 QList_Events::iterator it = subset.begin(); 88 94 for (; it != subset.end(); ++it) 89 95 delete *it; … … 102 108 return chanid; 103 109 } 104 110 105 voidEITHelper::UpdateEITList(int mplexid, const QList_Events &events)111 uint EITHelper::UpdateEITList(int mplexid, const QList_Events &events) 106 112 { 107 113 MSqlQuery query1(MSqlQuery::InitCon()); 108 114 MSqlQuery query2(MSqlQuery::InitCon()); … … 122 128 VERBOSE(VB_SCHEDULE, QString("EITHelper: Added %1 events in this pass") 123 129 .arg(counter)); 124 130 } 131 eitCount += counter; 132 return counter; 125 133 } 126 134 127 135 static int get_chan_id_from_db(int mplexid, const Event &event) -
libs/libmythtv/eithelper.h
old new 20 20 { 21 21 Q_OBJECT 22 22 public: 23 EITHelper() : QObject(NULL, "EITHelper") { ; }23 EITHelper() : QObject(NULL, "EITHelper"), eitCount(0) { ; } 24 24 25 25 void ClearList(void); 26 26 uint GetListSize(void) const; … … 31 31 32 32 private: 33 33 int GetChanID(int tid_db, const Event &event) const; 34 static voidUpdateEITList(int mplexid, const QList_Events &events);34 uint UpdateEITList(int mplexid, const QList_Events &events); 35 35 36 36 QListList_Events eitList; ///< Event Information Tables List 37 37 mutable QMutex eitList_lock; ///< EIT List lock … … 39 39 40 40 /// Maximum number of DB inserts per ProcessEvents call. 41 41 static const uint kChunkSize; 42 uint eitCount; 42 43 }; 43 44 44 45 #endif // USING_DVB