Strange lines in timer.cpp (doing nothing)

Alles rund um das grafische Benutzerinterface Enigma
Sat-turner
Neugieriger
Neugieriger
Beiträge: 11
Registriert: Freitag 18. März 2005, 13:47

Strange lines in timer.cpp (doing nothing)

Beitrag von Sat-turner »

Hello,

Since the last update of timer.cpp (12 June) there are a couple of lines that do nothing (I think). This may be a mistake, so I bring it to the attention. It is about the following lines:

Code: Alles auswählen

line 198:
	eEPGCache::getInstance()->lookupEvent( ref, time );

line 2413:
	eEPGCache::getInstance()->lookupEvent( (eServiceReferenceDVB&)tmpService, newEventBegin+newEventDuration / 2 );
To opinion a value is returned by these calls which is not stored anywhere. Also the values of the parameters will not be changed by this call. Is this a mistake?

I tried to change both lines in something like:

Code: Alles auswählen

tmp = eEPGCache::getInstance()->lookupEvent( bla, bla ) ;
But then the old error with scheduling repeated timer events appeared again. That one was gone since the last update. I must admit that I do not understand why the cache is parsed to get event data :oops:

Can anyone shine a light? That would be great.

Thanks,
Sat-Turner
__Ghost__
Developer
Beiträge: 245
Registriert: Mittwoch 13. März 2002, 21:19

Re: Strange lines in timer.cpp (doing nothing)

Beitrag von __Ghost__ »

Sat-turner hat geschrieben: Since the last update of timer.cpp (12 June) there are a couple of lines that do nothing (I think). This may be a mistake, so I bring it to the attention. It is about the following lines:

Code: Alles auswählen

line 198:
	eEPGCache::getInstance()->lookupEvent( ref, time );

line 2413:
	eEPGCache::getInstance()->lookupEvent( (eServiceReferenceDVB&)tmpService, newEventBegin+newEventDuration / 2 );
Oh yes.. this is a bug... tmp= eEPGCache::.... is correct..
I fix this in the CVS.. thanks !
Sat-turner hat geschrieben: But then the old error with scheduling repeated timer events appeared again.
Hmm which error you mean?

cu
Sat-turner
Neugieriger
Neugieriger
Beiträge: 11
Registriert: Freitag 18. März 2005, 13:47

Beitrag von Sat-turner »

The last update solved a problem, but that will reappear if you just put "tmp =" in front of these lines. If you schedule a repeated timer event in the very near future then the field LAST_ACTIVATION will be filled with a very wrong value, somthing like "10522", although this event has never run. The result is that the event will never run. Here is an outline of timer.log of such an event:

02.08, 17:05 - --> actionHandler() calldepth=1 setNextEvent
02.08, 17:05 - (0), descr = NED1/Ingang Oost
02.08, 17:05 - - time_begin = 66300, getDate()=102108105, lastActivation=126107
02.08, 17:05 - - isRepeating event (days Di)
02.08, 17:05 - - starts at 1123003500 (02.08, 19:25)
02.08, 17:05 - - is our new nextEvent... timeToNextEvent is 8366
02.08, 17:05 - (1), descr = RTL4/The West Wing
02.08, 17:05 - - time_begin = -3000, getDate()=102108105, lastActivation=101108
02.08, 17:05 - - isRepeating event (days M)
02.08, 17:05 - - starts at 1123452600 (08.08, 00:10)
02.08, 17:05 - (2), descr = RTL4/Joan of Arcadia
02.08, 17:05 - - time_begin = 75300, getDate()=102108105, lastActivation=131107
02.08, 17:05 - - isRepeating event (days Z)
02.08, 17:05 - - starts at 1123444500 (07.08, 21:55)
02.08, 17:05 - (3), descr = /geen omschrijving beschikbaar
02.08, 17:05 - - time_begin = 58020, getDate()=102108105, lastActivation=10522
02.08, 17:05 - - isRepeating event (days M Di Wo)
02.08, 17:05 - - starts at 0 (01.01, 01:00)
02.08, 17:05 - our new nextStartingEvent:
02.08, 17:05 - - is a repeating event
02.08, 17:05 - - lastActivation was at 26.07.2005
02.08, 17:05 - - descr/service is NED1/Ingang Oost
02.08, 17:05 - - starts at 02.08, 19:25

Why is the cache browsed anyway?

Regards,
Sat-Turner
__Ghost__
Developer
Beiträge: 245
Registriert: Mittwoch 13. März 2002, 21:19

Beitrag von __Ghost__ »

Hi,

i take a look at this..

bye
Sat-turner
Neugieriger
Neugieriger
Beiträge: 11
Registriert: Freitag 18. März 2005, 13:47

Beitrag von Sat-turner »

__Ghost__ hat geschrieben:Hi,

i take a look at this..

bye
Thanks for that :)

I would be happy to test a "beta" patch.

Regards,
Sat-Turner
__Ghost__
Developer
Beiträge: 245
Registriert: Mittwoch 13. März 2002, 21:19

Beitrag von __Ghost__ »

Hi,

hmm i cannot reproduce the problem with multiple timer and incorrect last activation..

When i add a multiple event.. the last activation is empty until the event has started..

bye
PLi®
Interessierter
Interessierter
Beiträge: 27
Registriert: Dienstag 25. Mai 2004, 20:31

Beitrag von PLi® »

__Ghost__ hat geschrieben:Hi,

hmm i cannot reproduce the problem with multiple timer and incorrect last activation..

When i add a multiple event.. the last activation is empty until the event has started..

bye
Tonight I did some research in the problem together with Sat-Turner.

The problem that occurs is that there is a union defined in ePlaylistEntry. What happens is that event_id of this union is being changed also when a recurring timer is being programmed. This should not happen.

There are two possible solutions in my opinion.

1. Get rid of the union, what is the use here? (then do initialisation of those vars)
2. Do not change event_id when programming a recurring timer by checking multiple->isChecked()

eg.

change line 2413 from

if (!tmp)

to

if (!tmp && !multiple->isChecked())


PLi®
__Ghost__
Developer
Beiträge: 245
Registriert: Mittwoch 13. März 2002, 21:19

Beitrag von __Ghost__ »

Hi,

oh shit.. i have read this to late..

now i have self searched and fixed the bug :)

thx anyway
PLi®
Interessierter
Interessierter
Beiträge: 27
Registriert: Dienstag 25. Mai 2004, 20:31

Beitrag von PLi® »

__Ghost__ hat geschrieben:Hi,

oh shit.. i have read this to late..

now i have self searched and fixed the bug :)

thx anyway
Too bad :-)

Do you have any idea why there is chosen to use a union in the ePlaylistEntry struct? Not very usefull in this situation I guess and faillures can be made easlily this way as we saw

Peter
__Ghost__
Developer
Beiträge: 245
Registriert: Mittwoch 13. März 2002, 21:19

Beitrag von __Ghost__ »

Hi,

why not a union :)

It saves memory ;)

A repeated timer don't need a event_id ... the event description must be searched by start_time.

bye
PLi®
Interessierter
Interessierter
Beiträge: 27
Registriert: Dienstag 25. Mai 2004, 20:31

Beitrag von PLi® »

__Ghost__ hat geschrieben:Hi,

why not a union :)

It saves memory ;)

A repeated timer don't need a event_id ... the event description must be searched by start_time.

bye
If memory is an issue there are a lot of other things that can save more memory, we're talking about 8 bytes of savings ;-)

I understand that the repeated timer does not need the event_id but the problem is that a mistake is easily being made using a union, therefore in my opinion it is not worth it to use a union here.

Peter