Skip to content

Commit c619856

Browse files
author
Clement Champetier
committed
VideoProperties: return fps as a float type
Double type is not constructed the same way in C++ and Java, and does not exist in python. Our bindings of 'C++ double' could create issues, and since a fps with a simple precision is enough, we decided to return fps as float.
1 parent cda8459 commit c619856

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/AvTranscoder/mediaProperty/VideoProperties.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,9 @@ int VideoProperties::getLevel() const
518518
return _codecContext->level;
519519
}
520520

521-
double VideoProperties::getFps() const
521+
float VideoProperties::getFps() const
522522
{
523-
size_t nbFrames = getNbFrames();
523+
const size_t nbFrames = getNbFrames();
524524
if( nbFrames )
525525
{
526526
double duration = getDuration();
@@ -531,7 +531,7 @@ double VideoProperties::getFps() const
531531

532532
// if nbFrames of stream is unknwon
533533
Rational timeBase = getTimeBase();
534-
double fps = timeBase.den / (double) timeBase.num;
534+
float fps = timeBase.den / (double) timeBase.num;
535535
if( std::isinf( fps ) )
536536
{
537537
std::ostringstream os;

src/AvTranscoder/mediaProperty/VideoProperties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AvExport VideoProperties : public StreamProperties
5656
int getProfile() const;
5757
int getLevel() const;
5858

59-
double getFps() const;
59+
float getFps() const;
6060

6161
bool hasBFrames() const;
6262
//bool isClosedGop() const;

0 commit comments

Comments
 (0)