Skip to content

Commit c78dd0b

Browse files
committed
Add comments about the time range duration
Signed-off-by: Darby Johnston <[email protected]>
1 parent 7689cf7 commit c78dd0b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/opentime/timeRange.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class TimeRange
5858
/// @brief Returns true if the time range is invalid.
5959
///
6060
/// The time range is considered invalid if either the start time or
61-
/// duration is invalid.
61+
/// duration is invalid, or if the duration is less than zero.
6262
bool is_invalid_range() const noexcept
6363
{
6464
return _start_time.is_invalid_time() || _duration.is_invalid_time() || _duration.value() < 0.0;
@@ -67,7 +67,8 @@ class TimeRange
6767
/// @brief Returns true if the time range is valid.
6868
///
6969
/// The time range is considered valid if both the start time and
70-
/// duration are valid.
70+
/// duration are valid, and the duration is greater than or equal to
71+
/// zero.
7172
bool is_valid_range() const noexcept
7273
{
7374
return _start_time.is_valid_time() && _duration.is_valid_time() && _duration.value() >= 0.0;

src/py-opentimelineio/opentime-bindings/opentime_timeRange.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ meaning that :meth:`end_time_inclusive` (last portion of a sample in the time ra
4545
.def(py::init<double, double, double>(), "start_time"_a, "duration"_a, "rate"_a)
4646
.def("is_invalid_range", &TimeRange::is_invalid_range, R"docstring(
4747
Returns true if the time range is invalid. The time range is considered invalid if either the start time or
48-
duration is invalid.
48+
duration is invalid, or if the duration is less than zero.
4949
)docstring")
5050
.def("is_valid_range", &TimeRange::is_valid_range, R"docstring(
5151
Returns true if the time range is valid. The time range is considered valid if both the start time and
52-
duration are valid.
52+
duration are valid, and the duration is greater than or equal to zero.
5353
)docstring")
5454
.def_property_readonly("start_time", &TimeRange::start_time)
5555
.def_property_readonly("duration", &TimeRange::duration)

0 commit comments

Comments
 (0)