mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
media/avrecorder: bias size limit by 1% to account for muxing overhead
This commit is contained in:
parent
304e57cbf0
commit
860693936f
1 changed files with 3 additions and 1 deletions
|
|
@ -69,6 +69,8 @@ bool Impl::Queue<T>::advance(int new_pts, int duration)
|
|||
|
||||
if (impl_->max_size_)
|
||||
{
|
||||
constexpr float kError = 0.99f; // 1% muxing overhead
|
||||
|
||||
const MediaEncoder::BitRate est = encoder_->estimated_bit_rate();
|
||||
|
||||
const float br = est.bits / 8.f;
|
||||
|
|
@ -76,7 +78,7 @@ bool Impl::Queue<T>::advance(int new_pts, int duration)
|
|||
// count size of already queued frames too
|
||||
const float t = ((duration + queued_frames_) * time_scale()) / est.period;
|
||||
|
||||
if ((impl_->container_->size() + (t * br)) > *impl_->max_size_)
|
||||
if ((impl_->container_->size() + (t * br)) > (*impl_->max_size_ * kError))
|
||||
{
|
||||
return finish(), false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue