Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A couple of bug fixes #820

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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