Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[fix]: correctly retrieve the fileSize on 32 bits OS#306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
adoussot merged 4 commits intoavTranscoder:developfromadoussot:develop
Jul 2, 2018

Conversation

adoussot
Copy link
Contributor

"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

"size_t" size depends on the OS. On 32-bit system it can only hold a 32bits variable = 4 294 967 296, which is not enough to store a big filesize (e.g: 14Go). We should use a 64-bits variable
@@ -210,7 +210,7 @@ size_t FileProperties::getBitRate() const
return _avFormatContext->bit_rate;
}

size_t FileProperties::getFileSize() const
unsigned __int64 FileProperties::getFileSize() const

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do you want me to define a new type in std namespace ?

e.g (this is pseudo-code)

// compatibility problems...namespacestd{#ifdef 32bit-OS// use https://stackoverflow.com/questions/1505582/determining-32-vs-64-bit-in-c to define the system typetypedef Custom_size_tc_size_t// can hold 64-bits#elsetypedef ::size_tc_size_t#endif}

I'm not really use to c++ but doesn't it seem a bit weird ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why not just useuint64_t? It is multi-platform (#include <cstdint>) and dedicated to provide fixed size integer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Indeeduint64_t seems to be what you are looking for (it is provided by the C library).
Did you test it@adoussot ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, i thoughtunsigned __int64 was cross platform (which is not). souint64_t is correct. Thanks!

@adoussot
Copy link
ContributorAuthor

Is this Ok (RTM) ? Or should we still change something ?

@fabiencastan
Copy link
Contributor

Would be good to add a comment to the function , like

/** * @note Ensure 64 bits size even on 32 bits OS with uint64_t, so we can manage large files > 4Go. */

@adoussot
Copy link
ContributorAuthor

Since the previous PR#305 was incrementing the avtranscoder version directly in develop (and didn't merge to master) I stick to the same release policy and incremented micro version in086d074.

If it's ok for you, could someone merge it ? Without any response, I will merge this PR by the end of the weekend. thanks

@adoussotadoussot merged commit4a61763 intoavTranscoder:developJul 2, 2018
valnoel added a commit to valnoel/avTranscoder that referenced this pull requestNov 22, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabiencastanfabiencastanfabiencastan left review comments

@cchampetcchampetcchampet left review comments

@MarcAntoine-ArnaudMarcAntoine-ArnaudMarcAntoine-Arnaud approved these changes

Assignees

@cchampetcchampet

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@adoussot@fabiencastan@MarcAntoine-Arnaud@cchampet

[8]ページ先頭

©2009-2025 Movatter.jp