Skip to content

Commit 4a61763

Browse files
authored
Merge pull request #306 from adoussot/develop
[fix]: correctly retrieve the fileSize on 32 bits OS
2 parents 1c318c2 + 086d074 commit 4a61763

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/AvTranscoder/common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define AVTRANSCODER_VERSION_MAJOR 0
55
#define AVTRANSCODER_VERSION_MINOR 14
6-
#define AVTRANSCODER_VERSION_MICRO 1
6+
#define AVTRANSCODER_VERSION_MICRO 2
77

88
#include <AvTranscoder/system.hpp>
99

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+
uint64_t 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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ 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+
/**
53+
* @note Use uint64_t instead of size_t to ensure 64 bits size on 32-bits OS so we can manage Files > 4Go
54+
*/
55+
uint64_t getFileSize() const; ///< in bytes
5356
size_t getPacketSize() const;
5457

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

0 commit comments

Comments
 (0)