timeline: added ability to move clips by sample in addition to by frame
This commit is contained in:
@@ -263,3 +263,13 @@ int64_t Timecode::time_to_timestamp(const double &time, const rational &timebase
|
||||
{
|
||||
return qRound64(time * timebase.flipped().toDouble());
|
||||
}
|
||||
|
||||
int64_t Timecode::rescale_timestamp(const int64_t &ts, const rational &source, const rational &dest)
|
||||
{
|
||||
return qRound64(static_cast<double>(ts) * source.toDouble() / dest.toDouble());
|
||||
}
|
||||
|
||||
int64_t Timecode::rescale_timestamp_ceil(const int64_t &ts, const rational &source, const rational &dest)
|
||||
{
|
||||
return qCeil(static_cast<double>(ts) * source.toDouble() / dest.toDouble());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user