From a5cddd3e01b7860814cf5ebd5e3a60bcc1c8c445 Mon Sep 17 00:00:00 2001 From: Adrian of Doom <52701496+futzu@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:03:44 -0400 Subject: [PATCH] Encoding the_upid.upid_value=self.segmentation_upid --- threefive/descriptors.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/threefive/descriptors.py b/threefive/descriptors.py index 493aae9f..8c120cd5 100644 --- a/threefive/descriptors.py +++ b/threefive/descriptors.py @@ -443,15 +443,19 @@ def mk_the_upid(self, bitbin=None): def _encode_segmentation(self, nbin): if self.segmentation_duration_flag: - nbin.add_int(self.as_ticks(self.segmentation_duration), 40) - the_upid = self.mk_the_upid() - the_upid.upid_value = self.segmentation_upid - the_upid.encode(nbin) - if the_upid.upid_length: - self.segmentation_upid_length= the_upid.upid_length + if not self.segmentation_duration_ticks: + self.segmentation_duration_ticks = 0 + if self.segmentation_duration: + self.segmentation_duration_ticks = self.as_ticks( + self.segmentation_duration + ) + self._chk_var(int, nbin.add_int, "segmentation_duration_ticks", 40) self._chk_var(int, nbin.add_int, "segmentation_upid_type", 8) self._chk_var(int, nbin.add_int, "segmentation_upid_length", 8) - upid_type = self.segmentation_upid_type + upid_type=self.segmentation_upid_type + the_upid =upid_map[upid_type][1](None,upid_type,self.segmentation_upid_length) + the_upid.upid_value=self.segmentation_upid + the_upid.encode(nbin) self._chk_var(int, nbin.add_int, "segmentation_type_id", 8) self._encode_segments(nbin)