audio: use sample rate rather than timebase now they aren't interchangeable
This commit is contained in:
@@ -105,7 +105,7 @@ qint64 AudioParams::time_to_samples(const double &time) const
|
||||
|
||||
// NOTE: Not sure if we should round or ceil, but I've gotten better results with ceil.
|
||||
// Specifically, we seem to occasionally get straggler ranges that never cache with round.
|
||||
return qCeil(time_base().flipped().toDouble() * time);
|
||||
return qCeil(double(sample_rate()) * time);
|
||||
}
|
||||
|
||||
qint64 AudioParams::time_to_samples(const rational &time) const
|
||||
@@ -122,7 +122,7 @@ qint64 AudioParams::samples_to_bytes(const qint64 &samples) const
|
||||
|
||||
rational AudioParams::samples_to_time(const qint64 &samples) const
|
||||
{
|
||||
return time_base() * samples;
|
||||
return sample_rate_as_time_base() * samples;
|
||||
}
|
||||
|
||||
qint64 AudioParams::bytes_to_samples(const qint64 &bytes) const
|
||||
|
||||
Reference in New Issue
Block a user