startTimeBcd = (((startMjd - 40587) * 86400) + (UINT16(&buffer[2]) << 1));

I'm really struggling to understand some of the stuff in opentv.cpp and epgcache.cpp.
For instance the end of line 160 in opentv.cpp.
What is function UINT16?Code:startTimeBcd = (((startMjd - 40587) * 86400) + (UINT16(&buffer[2]) << 1));
I've written C before but what does "&buffer[2]" do?
& is the "address off" function but the result is treated as if it was a number not an address (it's shifted left)!?
At a guess, a cast to an unsigned 16-bit integer.What is function UINT16?
&buffer[2] is the location of the 3rd element of buffer.I've written C before but what does "&buffer[2]" do?
& is the "address off" function but the result is treated as if it was a number not an address (it's shifted left)!?
86400 isn't arbitrary - it's the number of seconds in a day.Also where have those arbitrary values of 40587 and 86400 come from?
https://www.secret-bases.co.uk/wiki/Julian_day_number
Can't tell you about the UINT stuff, but the calculation before the "+" seems to be the number of seconds in the integer days elapsed since 1/1/1970. (startTimeBcd is the startMjd (current day number since 17 November 1858) less the number of days to the unix epoch (1/1/1970) multiplied by the number of seconds in a day. Presumably the &buffer[2] contains a number of seconds to establish the start time in BCD?
It's odd that the time errors in the EPG times are offset 36 hours and 24 minutes ahead, i.e. 2184 minutes which is 0x888 or binary 100010001000. Seems like some error in data manipulation, maybe?
start_time: This 40-bit field contains the start time of the event in Universal Time, Co-ordinated (UTC) and Modified
Julian Date (MJD) (see annex C). This field is coded as 16 bits giving the 16 LSBs of MJD followed by 24 bits coded as
6 digits in 4-bit Binary Coded Decimal (BCD). If the start time is undefined (e.g. for an event in a NVOD reference
service) all bits of the field are set to "1".
EXAMPLE 1:
93/10/13 12:45:00 is coded as "0xC079124500".
duration: A 24-bit field containing the duration of the event in hours, minutes, seconds. format: 6 digits,
4-bit BCD = 24 bit.
EXAMPLE 2:
01:45:30 is coded as "0x014530".
It's possible to get a raw dump of the data using the OpenWebIF API.Has anyone tried viewing the OpenWebIf version of the epg when the overlaps are showing via the gui?
https://dream.reichholf.net/e2web/
At least one does (I don't know about the others as the phantoms are now in the past in many cases)Has anyone tried viewing the OpenWebIf version of the epg when the overlaps are showing via the gui?
A search on the phantom finds other instances on other channels.Also, does epg search find the phantom programmes?
At a guess, a cast to an unsigned 16-bit integer.
&buffer[2] is the location of the 3rd element of buffer.
It's the same as buffer +2.
It's possible that UINT16 takes an address and uses it as a pointer to an unsigned 16-bit integer, whence shifting would be OK.
So the secret is to determine what UNT16 actually is.
A lot of network code does that (through macros).But it swaps the byte order if necessary depending on the architecture of the targeted system.
Sky ITV London Weather is in some schedules starting at 15:59 today - I haven't sky so don't see it on ViX, but there are others on freeview ...Do any legitimate EPG entries ever start at xx:x4 or xx:x9 ?
I don't think I've ever seen any.
Bates Motel (BBC1HD @23:25-00:10) should have a phantom on Thursday ay 11:49. There is nothing in the guide yet, lets see if this changes tomorrow when the original has moved into the past.

I don't think I'm getting any "phantoms" if I run EPG Refresh daily at 08:37 instead of my usual 03:37.
But I will continue to experiment running it manually after midnight.
A one off test at a set time for a day or two isn't necessarily going to provide any meaningful results.
Without changing any settings, in the past 3 days I’ve only seen one occurrence of the problem but this doesn’t mean that tomorrow, or within a week, I will access the EPG and see duplicates on half a dozen channels.