Skip to content

Commit c8d8f60

Browse files
author
Clement Champetier
committed
AudioDesc: add setAudioParameters from an audioFrameDesc
1 parent 482f304 commit c8d8f60

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/AvTranscoder/CodedStructures/AudioDesc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ const AVSampleFormat AudioDesc::getSampleFormat() const
5353
return m_codecContext->sample_fmt;
5454
}
5555

56+
void AudioDesc::setAudioParameters( const AudioFrameDesc& audioFrameDesc )
57+
{
58+
setAudioParameters( audioFrameDesc.getSampleRate(), audioFrameDesc.getChannels(), audioFrameDesc.getSampleFormat() );
59+
}
5660

5761
void AudioDesc::setAudioParameters( const size_t sampleRate, const size_t channels, const AVSampleFormat sampleFormat )
5862
{

src/AvTranscoder/CodedStructures/AudioDesc.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class AvExport AudioDesc : public CodedDesc
2424
const size_t getChannels() const;
2525
const AVSampleFormat getSampleFormat() const;
2626

27+
void setAudioParameters( const AudioFrameDesc& audioFrameDesc );
2728
void setAudioParameters( const size_t sampleRate, const size_t channels, const AVSampleFormat sampleFormat );
2829
};
2930

0 commit comments

Comments
 (0)