aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-08-05 12:04:45 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-08-05 12:04:45 +0000
commit7a577a5658dc2e4b5f309825cb82ef27b51724c7 (patch)
treec4334fa4f01579423961d6807147275466f34f87
parent0cd70b81a0ed8405b8866664fa51d9224aba0b7e (diff)
parent0bd2d6331bde6053d778f84633759f1336627a79 (diff)
downloadv4l2_codec2-7a577a5658dc2e4b5f309825cb82ef27b51724c7.tar.gz
Change-Id: I18b53b52014f4780486395e409be601066b9cc00
-rw-r--r--components/V4L2EncodeComponent.cpp3
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));