Skip to content

Commit

Permalink
Merge pull request #820 from happycube/chad-2022.12.19
Browse files Browse the repository at this point in the history
A couple of bug fixes
  • Loading branch information
happycube committed Dec 21, 2022
2 parents de48d66 + f9a778e commit 4779d38
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lddecode/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3665,13 +3665,21 @@ def readfield(self, initphase=False):
acceptable_diff = 2 if self.fields_written else 0.5

if max((whitediff, ire0_diff, sync_ire_diff)) > acceptable_diff:
redo = True

self.rf.DecoderParams["ire0"] = ire0_hz
# Note that vsync_ire is a negative number, so (sync_hz - ire0_hz) is correct
self.rf.DecoderParams["hz_ire"] = (ire100_hz - ire0_hz) / 100
self.rf.DecoderParams["vsync_ire"] = (sync_hz - ire0_hz) / self.rf.DecoderParams["hz_ire"]
#print(self.rf.DecoderParams["ire0"], self.rf.DecoderParams["hz_ire"], self.rf.DecoderParams["vsync_ire"])
hz_ire = (ire100_hz - ire0_hz) / 100
vsync_ire = (sync_hz - ire0_hz) / hz_ire

if vsync_ire > -20:
logger.warning(
"At field #{0}, Auto-level detection malfunction (vsync IRE computed at {1}, nominal ~= -40), possible disk skipping".format(
len(self.fieldinfo), np.round(vsync_ire, 2)
))
else:
redo = True

self.rf.DecoderParams["ire0"] = ire0_hz
# Note that vsync_ire is a negative number, so (sync_hz - ire0_hz) is correct
self.rf.DecoderParams["hz_ire"] = hz_ire
self.rf.DecoderParams["vsync_ire"] = vsync_ire

if adjusted is False and redo is True:
self.demodcache.flush_demod()
Expand Down Expand Up @@ -4014,7 +4022,7 @@ def buildmetadata(self, f, check_phase=True):
disk_TimeCode = f"{self.clvMinutes}:xx"
# print("file frame %d early-CLV minute %d" % (rawloc, self.clvMinutes), file=sys.stderr)
elif self.isCLV and self.frameNumber is not None:
disk_TimeCode = "CLV Timecode %d:%.2d.%.2d frame %d" % (
disk_TimeCode = "%d:%.2d.%.2d Frame #%d" % (
self.clvMinutes,
self.clvSeconds,
self.clvFrameNum,
Expand Down

0 comments on commit 4779d38

Please sign in to comment.