Skip to content

Commit da115d7

Browse files
committed
fix: default to field_order_action none on typec and some more fixes to compensate for lack of vsync there
still some issues with offset/order though
1 parent 3261fec commit da115d7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

vhsdecode/process.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ def __init__(
166166

167167
self.debug_plot = debug_plot
168168
self.field_order_action = field_order_action
169+
if tape_format == "TYPEC":
170+
# Since typec usually lacks vsync set this to none to avoid dropping fields.
171+
self.field_order_action = "none"
169172
self.duplicate_prev_field = True
170173

171174
# Needs to be overridden since this is overwritten for 405-line.
@@ -239,6 +242,9 @@ def buildmetadata(self, f, check_phase=False):
239242
and prevfi_2["detectedFirstField"] == prevfi_1["detectedFirstField"]
240243
# and this field is within a reasonable distance to be valid
241244
and lddu.inrange(distance_from_previous_field, 0.9, 1.1)
245+
# Skip on TYPEC since we expect to have missing vsync there and we don't
246+
# expect progressive video.
247+
and self.rf.options.tape_format != "TYPEC"
242248
):
243249
# treat this as progressive, and manually flip the field order
244250
ldd.logger.error(
@@ -264,9 +270,10 @@ def buildmetadata(self, f, check_phase=False):
264270
self.duplicate_prev_field = not self.duplicate_prev_field
265271

266272
if self.field_order_action == "none":
267-
ldd.logger.error(
268-
"Possibly skipped field (Two fields with same isFirstField in a row), manually flipping the field order to compensate"
269-
)
273+
if self.rf.options.tape_format != "TYPEC":
274+
ldd.logger.error(
275+
"Possibly skipped field (Two fields with same isFirstField in a row), manually flipping the field order to compensate"
276+
)
270277
decode_faults |= 4
271278
fi["syncConf"] = 0
272279
fi["isFirstField"] = not prevfi_1["isFirstField"]

0 commit comments

Comments
 (0)