Skip to content

Commit 0c3bf14

Browse files
author
Clement Champetier
committed
AudioReader: fix nbChannels of output when extract one channel
No need to call updateOutput AudioReader::method when specify a channelIndex in constructor.
1 parent 1a635be commit 0c3bf14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AvTranscoder/reader/AudioReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void AudioReader::init()
4949
AudioFrame* srcFrame = static_cast<AudioFrame*>(_srcFrame);
5050
// create dst frame
5151
_outputSampleRate = srcFrame->desc().getSampleRate();
52-
_outputNbChannels = srcFrame->desc().getChannels();
52+
_outputNbChannels = (_channelIndex == -1) ? srcFrame->desc().getChannels() : 1;
5353
_dstFrame = new AudioFrame( AudioFrameDesc( _outputSampleRate, _outputNbChannels, _outputSampleFormat ) );
5454
}
5555

0 commit comments

Comments
 (0)