AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO

Semantics of optional<TimeRange> at MediaReference

Open
#729 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2k
Forks
351
Avg merge
1d 12h
Merged PRs (30d)
1

Description

`MediaReference::available_range` is optional according to the class definition.

`Clip::available_range()` however:

* reports an error when `MediaReference::available_range` is absent; and
* simultaneously returns a valid `TimeRange()`.

Couple of questions come to mind:

- why isn't `MediaReference::available_range` mandatory with a default value of `TimeRange()`? As a corollary, what is the difference in semantics between an absent `MediaReference::available_range` and `MediaReference::available_range` set to `TimeRange()`?
- why does `Clip::available_range()` both signal an error and return a valid value? In practice, this means that the error will be ignored, or perhaps this is merely a warning instead of an error?

Contributor guide

Open the contributing guide

Research direction

Start by reading the MediaReference::available_range definition and the implementation or contract of Clip::available_range. Determine the intended distinction between an absent range and TimeRange(), and whether returning a value while reporting an error is deliberate. Done means the API semantics and error/value contract are decided and documented or tracked as a focused change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.