[mythtv] [mythtv-commits] [MythTV/mythtv] 035a52: No discontinuity for first TS packet of PID

David Engel david at istwok.net
Sat Aug 29 22:04:41 UTC 2020


On Sat, Aug 29, 2020 at 11:27:01PM +0200, Klaas de Waal wrote:
> I do feel a bit silly. It looks like the only thing that needs to be done
> to fix the code is to initialize all elements of m_continuityCounter to
> 0xff. The function CheckCC in dtvrecorder.h does already test for value
> 0xff. In mythv version 30  a memset is used to set all elements of
> continuity_counter (as it was called then) to 0xff.
> Somewhere along the way the initialization must have been lost. To be
> continued.

That happens all to often with subtle code and developer churn.  I
have a saying I came up with several years ago after many times trying
to reconstruct the logic behind code that had seen many iterations.
It goes like this:

Every line of code had a reason for being at one time.  It might not
have been a good reason then, now or ever, but there was a reason.  If
you don't know what that reason was, be very careful removing or
modifying that code.

David
-- 
David Engel
david at istwok.net


More information about the mythtv-dev mailing list