Skip to content

In Formula normalizing PCR: pcr = (pcr - ts.HZ + ts.PCR_CYCLE) % ts.PCR_CYCLE. #8

Description

@TKNgu

In Formula normalizing PCR:
pcr = (pcr - ts.HZ + ts.PCR_CYCLE) % ts.PCR_CYCLE

Why need minus for ts.HZ ? And why input function def pcr is DTS ?

Sorrry for my English.

`
def pcr(self, pcr: int):

pcr = (pcr - ts.HZ + ts.PCR_CYCLE) % ts.PCR_CYCLE

diff = ((pcr - self.latest_pcr_value + ts.PCR_CYCLE) % ts.PCR_CYCLE) if self.latest_pcr_value is not None else 0

self.latest_pcr_monotonic_timestamp_90khz += diff

if self.latest_pcr_datetime is None: self.latest_pcr_datetime = datetime.now(timezone.utc) - timedelta(seconds=(1))

self.latest_pcr_datetime += timedelta(seconds=(diff / ts.HZ))

self.latest_pcr_value = pcr

`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions