diff options
author | Xin Li <delphij@google.com> | 2022-10-06 12:01:48 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2022-10-06 12:01:48 -0700 |
commit | 2d9f68b8be4edfbde5925e3736e6110cc4f1c676 (patch) | |
tree | 93dbba2556ecf85481be7807f6db8098015a21f9 | |
parent | 282b06666db160b5b53ef9e736913cbc1e06b6eb (diff) | |
parent | 121895ee6573ee715843099106d5fc84ea76001e (diff) | |
download | v4l2_codec2-2d9f68b8be4edfbde5925e3736e6110cc4f1c676.tar.gz |
Merge tm-qpr-dev-plus-aosp-without-vendor@9129937
Bug: 248070379
Merged-In: I3ceefaad9b420f86e4f0b524e6f0b5649af9997b
Change-Id: I646c183bf1d60d6732e01092e8868e1d177b7936
-rw-r--r-- | components/V4L2EncodeComponent.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/V4L2EncodeComponent.cpp b/components/V4L2EncodeComponent.cpp index 4ce4404..c2a2679 100644 --- a/components/V4L2EncodeComponent.cpp +++ b/components/V4L2EncodeComponent.cpp @@ -757,7 +757,8 @@ bool V4L2EncodeComponent::encode(C2ConstGraphicBlock block, uint64_t index, int6 constexpr int64_t kMaxFramerateDiff = 5; if (mLastFrameTime && (timestamp > *mLastFrameTime)) { int64_t newFramerate = std::max( - static_cast<int64_t>(std::round(1000000.0 / (timestamp - *mLastFrameTime))), 1LL); + static_cast<int64_t>(std::round(1000000.0 / (timestamp - *mLastFrameTime))), + static_cast<int64_t>(1LL)); if (abs(mFramerate - newFramerate) > kMaxFramerateDiff) { ALOGV("Adjusting framerate to %" PRId64 " based on frame timestamps", newFramerate); mInterface->setFramerate(static_cast<uint32_t>(newFramerate)); |