File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
#include " AudioFrame.hpp"
2
2
3
3
#include < stdexcept>
4
+ #include < stdlib.h>
4
5
5
6
namespace avtranscoder
6
7
{
@@ -44,8 +45,18 @@ void AudioFrameDesc::setSampleFormat( const std::string& sampleFormatName )
44
45
45
46
void AudioFrameDesc::setParameters ( const ProfileLoader::Profile& profile )
46
47
{
47
- if ( profile.find ( constants::avProfileSampleFormat ) != profile.end () )
48
+ // sample rate
49
+ if ( profile.count ( constants::avProfileSampleRate ) )
50
+ setSampleRate ( atoi ( profile.find ( constants::avProfileSampleRate )->second .c_str () ) );
51
+ // channel
52
+ if ( profile.count ( constants::avProfileChannel ) )
53
+ setChannels ( atoi ( profile.find ( constants::avProfileChannel )->second .c_str () ) );
54
+ // sample format
55
+ if ( profile.count ( constants::avProfileSampleFormat ) )
48
56
setSampleFormat ( profile.find ( constants::avProfileSampleFormat )->second );
57
+ // fps
58
+ if ( profile.count ( constants::avProfileFrameRate ) )
59
+ setFps ( atof ( profile.find ( constants::avProfileFrameRate )->second .c_str () ) );
49
60
}
50
61
51
62
}
You can’t perform that action at this time.
0 commit comments