Skip to content

Commit aaa66ef

Browse files
committed
Merge pull request #76 from cchampet/fix_Properties_getFps
Fix getFps of properties
2 parents 100ee81 + a9ebba0 commit aaa66ef

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

src/AvTranscoder/mediaProperty/AudioProperties.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,6 @@ Rational AudioProperties::getTimeBase() const
189189
return timeBase;
190190
}
191191

192-
double AudioProperties::getFps() const
193-
{
194-
Rational timeBase = getTimeBase();
195-
double fps = timeBase.den / (double) timeBase.num;
196-
if( isinf( fps ) )
197-
fps = 0.0;
198-
return fps;
199-
}
200-
201192
double AudioProperties::getDuration() const
202193
{
203194
Rational timeBase = getTimeBase();
@@ -224,7 +215,6 @@ PropertiesMap AudioProperties::getPropertiesAsMap() const
224215
detail::add( dataMap, "channelDescription", getChannelDescription() );
225216
detail::add( dataMap, "ticksPerFrame", getTicksPerFrame() );
226217
detail::add( dataMap, "timeBase", getTimeBase() );
227-
detail::add( dataMap, "fps", getFps() );
228218
detail::add( dataMap, "duration", getDuration() );
229219

230220
for( size_t metadataIndex = 0; metadataIndex < _metadatas.size(); ++metadataIndex )

src/AvTranscoder/mediaProperty/AudioProperties.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class AvExport AudioProperties
3535

3636
size_t getTicksPerFrame() const;
3737
Rational getTimeBase() const;
38-
double getFps() const; ///< Corresponds to the number of audio samples for one video frame
3938
double getDuration() const;
4039

4140
PropertiesMap& getMetadatas() { return _metadatas; }

src/AvTranscoder/mediaProperty/VideoProperties.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,7 @@ int VideoProperties::getLevel() const
478478

479479
double VideoProperties::getFps() const
480480
{
481-
Rational timeBase = getTimeBase();
482-
double fps = timeBase.den / (double) timeBase.num;
483-
if( isinf( fps ) )
484-
fps = 0.0;
485-
return fps;
481+
return getNbFrames() / getDuration();
486482
}
487483

488484
double VideoProperties::getDuration() const

0 commit comments

Comments
 (0)