Skip to content

Commit e5f16f7

Browse files
author
Clement Champetier
committed
AudioDecoder: checked if no need to extract one channel in the audio stream
1 parent 4c480ce commit e5f16f7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/AvTranscoder/decoder/AudioDecoder.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer, const size_t channelIndex
116116
{
117117
AudioFrame& audioBuffer = static_cast<AudioFrame&>(frameBuffer);
118118

119+
// if no need to extract one channel in the audio stream
120+
if(audioBuffer.getNbChannels() == 1 && channelIndex == 0)
121+
{
122+
return decodeNextFrame(frameBuffer);
123+
}
124+
119125
// decode all data of the next frame
120126
AudioFrame allDataOfNextFrame(audioBuffer);
121127
if(!decodeNextFrame(allDataOfNextFrame))

0 commit comments

Comments
 (0)