Skip to content

Conversation

@julijane
Copy link
Contributor

@julijane julijane commented Mar 16, 2025

While looking through the code for functions/methods that maybe should have a test, I noticed that NewUTCSpliceTime overflows when the gpsepoch input plus the offset between unix epoch and gps epoch exceeds uint32. While this only happens in the year 2106 and it is questionable (but not ruled out 😬 ) that SCTE35 is still in use then, I found it wrong to leave it like that. Fixed that, now it works with all values for gpsepoch, which only overflows in the year 2116 when the range really ends (so roughly 10 years later). Also internally the time was not stored as UTC. While that probably makes no difference, I fixed that too.

The GPSSeconds method of UTCSpliceTime likewise had a overflow in the year 2106. Here it did not affect the result, as the subsequent subtraction in uint32 number space still resulted in the correct result, but again it felt wrong, to leave it like that.

Also added tests.

@julijane julijane requested a review from blahspam as a code owner March 16, 2025 20:34
@blahspam blahspam merged commit a53973e into Comcast:main Mar 16, 2025
2 checks passed
@julijane julijane deleted the juli/fix-gpstime-conversions branch March 17, 2025 17:49
@blahspam blahspam added the bug Something isn't working label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants