Skip to content

Commit cec93d6

Browse files
committed
fix: correctly retrieve the fileSize on 32 bits OS
"size_t" size depends on the OS. On 32-bit system it can only hold a 32 bits variable = 4 294 967 296, which is not enough to store a big file size (e.g: 14Go). We should use a 64-bits variable
1 parent 1c318c2 commit cec93d6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/AvTranscoder/properties/FileProperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ size_t FileProperties::getBitRate() const
210210
return _avFormatContext->bit_rate;
211211
}
212212

213-
size_t FileProperties::getFileSize() const
213+
unsigned __int64 FileProperties::getFileSize() const
214214
{
215215
std::ifstream in(getFilename().c_str(), std::ios::binary | std::ios::ate);
216216
return in.tellg();

src/AvTranscoder/properties/FileProperties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class AvExport FileProperties
4949
double getStartTime() const;
5050
float getDuration() const; ///< in seconds, 0 if not available
5151
size_t getBitRate() const; ///< total stream bitrate in bit/s, 0 if not available (result of a computation by ffmpeg)
52-
size_t getFileSize() const; ///< in bytes
52+
unsigned __int64 getFileSize() const; ///< in bytes
5353
size_t getPacketSize() const;
5454

5555
const PropertyVector& getMetadatas() const { return _metadatas; }

0 commit comments

Comments
 (0)