- storeTitle( itTitle, the_text, data );
- m_titles.erase( itTitle );
+ lenline = tmp[pos+len];
+ tmp[pos+len] = ' ';
+ len += lenline + 1;
+ }
+ if( len > 0 )
+ tmp[pos+len] = 0;
+ else
+ tmp[pos+1] = 0;
+
+ std::multimap<__u32, __u32>::iterator itProgId( m_program_ids.lower_bound(summary_id) );
+ if ( itProgId == m_program_ids.end() || itProgId->first != summary_id)
+ { /* This part is to prevent to looping forever if some summaries are not received yet.
+ There is a timeout of 4 sec. after the last successfully read summary. */
+ if ( !m_program_ids.empty() )
+ return; // Continue reading of the current table.
+ }
+ else
+ {
+ startTimeout(15000);
+ std::string the_text = (char *) (data + pos + 1);
+
+ while( itProgId != m_program_ids.end() && itProgId->first == summary_id )
+ {
+ // Find corresponding title, store title and summary in epgcache.
+ std::map<__u32, mhw_title_t>::iterator itTitle( m_titles.find( itProgId->second ) );
+ if ( itTitle != m_titles.end() )
+ {
+ storeTitle( itTitle, the_text, data );
+ m_titles.erase( itTitle );
+ }
+ m_program_ids.erase( itProgId++ );
+ }
+ if ( !m_program_ids.empty() )
+ return; // Continue reading of the current table.