Skip to content

Commit c43508c

Browse files
author
Clement Champetier
committed
AudioFrame: add setParameters from a profileDesc
1 parent 0f35296 commit c43508c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/AvTranscoder/EssenceStructures/AudioFrame.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <AvTranscoder/common.hpp>
55

66
#include "Frame.hpp"
7+
#include <AvTranscoder/Profile.hpp>
78

89
namespace avtranscoder
910
{
@@ -28,6 +29,12 @@ class AvExport AudioFrameDesc
2829
{
2930
return ( m_sampleRate / m_fps ) * m_channels * av_get_bytes_per_sample( m_sampleFormat );
3031
}
32+
33+
void setParameters( const Profile::ProfileDesc& desc )
34+
{
35+
if( desc.find( Profile::avProfileSampleFormat ) != desc.end() )
36+
setSampleFormat( desc.find( Profile::avProfileSampleFormat )->second );
37+
}
3138

3239
size_t getSampleRate() const { return m_sampleRate; }
3340
size_t getChannels () const { return m_channels; }

0 commit comments

Comments
 (0)