Skip to content

[BUG]: Fix in documentation #217

@vectronic

Description

@vectronic

Describe the bug
In the code example here:

https://github.com/bbc/tams/#flow-and-media-timelines

For the "timerange/ts_offset approach" pseudo-code it says:

object_ts = to_timestamp(ts)          # `4:0` for `ts = 4.0sec`
offset_object_ts = object_ts + ts_offset    # `4:0 + -0:700000000 = 3:300000000` (in Flow timeline)
if (offset_object_ts < timerange.start or
      offset_object_ts >= timerange.end):  # `3:300000000 is less than 3:500000000`
    discard_grain()                  # So this grain is discarded
else:
    keep_grain()                     # The first grain to be retained will have `object_ts = 4.2`
                                     # (and `offset_object_ts = 3:500000000 or 3.5sec)`

This doesn't match the diagram above in which object Y05 has a tr_offset of -0.8

Expected behavior

To match the diagram the pseudo-code should say:

`object_ts = to_timestamp(ts)          # `4:0` for `ts = 4.0sec`
offset_object_ts = object_ts + ts_offset    # `4:0 + -0:800000000 = 3:200000000` (in Flow timeline)
if (offset_object_ts < timerange.start or
      offset_object_ts >= timerange.end):  # `3:200000000 is less than 3:500000000`
    discard_grain()                  # So this grain is discarded
else:
    keep_grain()                     # The first grain to be retained will have `object_ts = 4.3`
                                     # (and `offset_object_ts = 3:500000000 or 3.5sec)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    tsc-discussDiscuss this issue at the next TSC meeting

    Type

    No fields configured for Bug.

    Projects

    Status
    In review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions