- August 12, 2012
- 470
- 167
- Home Country
- Germany
Hi,
I always wondered why EPG data is very often not updated and why I very often have no epg info on many channels.
Today I looked in the code and saw this code (EpgCard.cs):
So, if EPG Grabber is already updating some data, the new received EPG data will not be stored.
Also, if the TV Card is NOT in idle state, the method returns.
So is it true, that the EPG data will only be stored, if my tv card is in idle state? That will mean, the EPG is not stored while watching a channel? Is there any reason for this behaviour? In my opinion it makes more sense to store the EPG which will be received on the channel I'm watching, because this is the normal and expected behaviour of any set top box / tv / dvb software. If I always watch TV with my HTPC, so that my TV card is never in idle mode, EPG data will never be stored?
Or do I understand something completly wrong? :-(
Best regards,
Sascha
I always wondered why EPG data is very often not updated and why I very often have no epg info on many channels.
Today I looked in the code and saw this code (EpgCard.cs):
Code:
public override int OnEpgReceived()
{
try
{
//is epg grabbing in progress?
/*if (_state == EpgState.Idle)
{
Log.Epg("Epg: card:{0} OnEpgReceived while idle", _user.CardId);
return 0;
}*/
//is epg grabber already updating the database?
if (_state == EpgState.Updating)
{
Log.Epg("Epg: card:{0} OnEpgReceived while updating", _user.CardId);
return 0;
}
//is the card still idle?
if (IsCardIdle(_user) == false)
{
Log.Epg("Epg: card:{0} OnEpgReceived but card is not idle", _user.CardId);
_state = EpgState.Idle;
_tvController.StopGrabbingEpg(_user);
_user.CardId = -1;
_currentTransponder.InUse = false;
return 0;
}
List<EpgChannel> epg = _tvController.Epg(_user.CardId) ?? new List<EpgChannel>();
//did we receive epg info?
if (epg.Count == 0)
{
//no epg found for this transponder
Log.Epg("Epg: card:{0} no epg found", _user.CardId);
_currentTransponder.InUse = false;
_currentTransponder.OnTimeOut();
_state = EpgState.Idle;
_tvController.StopGrabbingEpg(_user);
_tvController.PauseCard(_user);
_user.CardId = -1;
_currentTransponder.InUse = false;
return 0;
}
//create worker thread to update the database
Log.Epg("Epg: card:{0} received epg for {1} channels", _user.CardId, epg.Count);
_state = EpgState.Updating;
_epg = epg;
Thread workerThread = new Thread(UpdateDatabaseThread);
workerThread.IsBackground = true;
workerThread.Name = "EPG Update thread";
workerThread.Start();
}
catch (Exception ex)
{
Log.Write(ex);
}
return 0;
}
So, if EPG Grabber is already updating some data, the new received EPG data will not be stored.
Also, if the TV Card is NOT in idle state, the method returns.
So is it true, that the EPG data will only be stored, if my tv card is in idle state? That will mean, the EPG is not stored while watching a channel? Is there any reason for this behaviour? In my opinion it makes more sense to store the EPG which will be received on the channel I'm watching, because this is the normal and expected behaviour of any set top box / tv / dvb software. If I always watch TV with my HTPC, so that my TV card is never in idle mode, EPG data will never be stored?
Or do I understand something completly wrong? :-(
Best regards,
Sascha
Last edited: