calculate audio bytes as a 64-bit number
This commit is contained in:
@@ -49,11 +49,11 @@ const QVector<uint64_t> AudioParams::kSupportedChannelLayouts = {
|
|||||||
AV_CH_LAYOUT_7POINT1
|
AV_CH_LAYOUT_7POINT1
|
||||||
};
|
};
|
||||||
|
|
||||||
int AudioParams::time_to_bytes(const double &time) const
|
qint64 AudioParams::time_to_bytes(const double &time) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(is_valid());
|
Q_ASSERT(is_valid());
|
||||||
|
|
||||||
return time_to_samples(time) * channel_count() * bytes_per_sample_per_channel();
|
return qint64(time_to_samples(time)) * channel_count() * bytes_per_sample_per_channel();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioParams::operator==(const AudioParams &other) const
|
bool AudioParams::operator==(const AudioParams &other) const
|
||||||
@@ -68,7 +68,7 @@ bool AudioParams::operator!=(const AudioParams &other) const
|
|||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
}
|
}
|
||||||
|
|
||||||
int AudioParams::time_to_bytes(const rational &time) const
|
qint64 AudioParams::time_to_bytes(const rational &time) const
|
||||||
{
|
{
|
||||||
return time_to_bytes(time.toDouble());
|
return time_to_bytes(time.toDouble());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ public:
|
|||||||
return format_;
|
return format_;
|
||||||
}
|
}
|
||||||
|
|
||||||
int time_to_bytes(const double& time) const;
|
qint64 time_to_bytes(const double& time) const;
|
||||||
int time_to_bytes(const rational& time) const;
|
qint64 time_to_bytes(const rational& time) const;
|
||||||
int time_to_samples(const double& time) const;
|
int time_to_samples(const double& time) const;
|
||||||
int time_to_samples(const rational& time) const;
|
int time_to_samples(const rational& time) const;
|
||||||
int samples_to_bytes(const int& samples) const;
|
int samples_to_bytes(const int& samples) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user