rosbag: support large bags (>2GB) on 32-bit #2759
This commit is contained in:
parent
185947eff8
commit
a439bfa968
|
@ -12,6 +12,9 @@ SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|||
SET(CMAKE_INSTALL_RPATH "${PROJECT_SOURCE_DIR}/lib")
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
# Support large bags (>2GB) on 32-bit systems
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||
|
||||
rosbuild_add_library(rosbag
|
||||
src/bag.cpp src/buffer.cpp src/bz2_stream.cpp src/chunked_file.cpp src/message_instance.cpp src/player.cpp
|
||||
src/query.cpp src/recorder.cpp src/stream.cpp src/time_translator.cpp src/uncompressed_stream.cpp src/view.cpp)
|
||||
|
|
|
@ -90,7 +90,7 @@ void ChunkedFile::open(string const& filename, string const& mode) {
|
|||
read_stream_ = shared_ptr<Stream>(new UncompressedStream(this));
|
||||
write_stream_ = shared_ptr<Stream>(new UncompressedStream(this));
|
||||
filename_ = filename;
|
||||
offset_ = ftell(file_);
|
||||
offset_ = ftello(file_);
|
||||
}
|
||||
|
||||
bool ChunkedFile::good() const {
|
||||
|
@ -150,11 +150,11 @@ void ChunkedFile::seek(uint64_t offset, int origin) {
|
|||
|
||||
setReadMode(compression::None);
|
||||
|
||||
int success = fseek(file_, offset, origin);
|
||||
int success = fseeko(file_, offset, origin);
|
||||
if (success != 0)
|
||||
throw BagIOException("Error seeking");
|
||||
|
||||
offset_ = ftell(file_);
|
||||
offset_ = ftello(file_);
|
||||
}
|
||||
|
||||
uint64_t ChunkedFile::getOffset() const { return offset_; }
|
||||
|
|
Loading…
Reference in New Issue