From 5291ae741bef15c24f510468a1791d393ba78484 Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu Date: Sun, 19 Jul 2026 18:05:13 +1000 Subject: [PATCH] Use portable bit-rate logging in ffmpeg_encoder_decoder This upstreams RoboStack downstream patch `patch/ros-rolling-ffmpeg-encoder-decoder.unix.patch`. bitRate_ is int64_t, so logging it through a long-specific format can warn or fail on platforms where long and int64_t differ. Use the PRId64 format macro from so the printf-style log format matches the fixed-width integer type portably. Signed-off-by: Tobias Fischer --- src/encoder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/encoder.cpp b/src/encoder.cpp index 80f1de4..e939deb 100644 --- a/src/encoder.cpp +++ b/src/encoder.cpp @@ -21,6 +21,7 @@ #include #endif +#include #include #include #include @@ -260,8 +261,8 @@ void Encoder::doOpenCodec(int width, int height, const std::string & origEncodin ss << " " << kv.first << "=" << kv.second; } RCLCPP_INFO( - logger_, "codec: %10s, bit_rate: %10ld qmax: %2d options: %s", encoder_.c_str(), bitRate_, - qmax_, ss.str().c_str()); + logger_, "codec: %10s, bit_rate: %10" PRId64 " qmax: %2d options: %s", encoder_.c_str(), + bitRate_, qmax_, ss.str().c_str()); RCLCPP_INFO_STREAM( logger_, "cv_bridge_target_format: " << cvBridgeTargetFormat_