Minor improvement precision media player gap timing

This commit is contained in:
Bruno Herbelin
2021-10-12 23:20:16 +02:00
parent 2c2584c8df
commit ce0ac1bee1
2 changed files with 19 additions and 3 deletions

View File

@@ -63,6 +63,14 @@ struct TimeInterval
}
return *this;
}
inline TimeInterval& operator %= (const GstClockTime& precision)
{
if (precision != GST_CLOCK_TIME_NONE && precision > 0) {
this->begin -= this->begin % precision;
this->end += precision - (this->end % precision) ;
}
return *this;
}
inline bool includes(const GstClockTime t) const
{
return (is_valid() && t != GST_CLOCK_TIME_NONE && !(t < this->begin) && !(t > this->end) );