<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 29 Aug 2020 at 21:43, David Engel <<a href="mailto:david@istwok.net" target="_blank">david@istwok.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Aug 29, 2020 at 07:36:37AM -0700, kmdewaal wrote:<br>
>   Branch: refs/heads/master<br>
>   Home:   <a href="https://github.com/MythTV/mythtv" rel="noreferrer" target="_blank">https://github.com/MythTV/mythtv</a><br>
>   Commit: cf8015eaf4a2fde6ece423e7ade99c86f7f9d076<br>
>       <a href="https://github.com/MythTV/mythtv/commit/cf8015eaf4a2fde6ece423e7ade99c86f7f9d076" rel="noreferrer" target="_blank">https://github.com/MythTV/mythtv/commit/cf8015eaf4a2fde6ece423e7ade99c86f7f9d076</a><br>
>   Author: Klaas de Waal <<a href="mailto:kdewaal@mythtv.org" target="_blank">kdewaal@mythtv.org</a>><br>
>   Date:   2020-08-29 (Sat, 29 Aug 2020)<br>
> <br>
>   Changed paths:<br>
>     M mythtv/libs/libmythtv/recorders/dtvrecorder.cpp<br>
>     M mythtv/libs/libmythtv/recorders/dtvrecorder.h<br>
> <br>
>   Log Message:<br>
>   -----------<br>
>   No discontinuity for first TS packet of PID<br>
> <br>
> Do not count the discontinuity from 0 to the continuity counter value of the first transport stream<br>
> packet of a PID as an error and consequently do also not give a "discontinuity detected" error message.<br>
> A perfect recording will now report a continuity_error_count of 0 instead of approximately the number of PIDs in the recording.<br>
<br>
By sheer coincidence, I've been debugging an issue with my setup and<br>
have been watching for continuity errors.  I was lamenting the fact<br>
that there were often false positives reported every time a recording<br>
starts when I saw you committed this change.  I see one problem with<br>
the change, though.  1/16th of the time, the first counter seen will<br>
actually be 0, which is the inital value in m_continuityCounter.  When<br>
that happens, reporting of the first, real discontinuity will be<br>
suppressed.<br>
<br>
I believe the attached patch fixes that issue by initializing<br>
m_continuityCounter to an impossible value.  That will always cause an<br>
initial continuity that can be safely ignored.  All continuity errors<br>
after that will be real and can be reported.<br>
<br><br></blockquote><div>Hi David,</div><div><br></div><div>Your analysis that 1/16th of the time the first real error is suppressed is of course correct.</div><div>I do appreciate your patch but it does need initialisation of all elements of m_continuityCounter to 0xff, not only the first element.</div><div>This can be done by calling m_continuityCounter.fill(0xff) in the constructor, I cannot find a way to do this in the header file.</div><div>I am testing this now and will commit it later.</div><div><br></div><div>Thanks,</div><div>Klaas.</div><div><br></div><div> </div></div></div>