Skip to content

Commit a66c49d

Browse files
author
Clement Champetier
committed
AudioDecoder: fix the number of channels used to compute the decoded size
No real impact in the process, because we only check that "decodedSize" is not equal to 0. But it is more accurate :)
1 parent 3a03cbf commit a66c49d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AvTranscoder/decoder/AudioDecoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ bool AudioDecoder::decodeNextFrame(IFrame& frameBuffer, const std::vector<size_t
153153
if(!decodeNextFrame(allDataOfNextFrame))
154154
return false;
155155

156-
const int dstNbChannels = 1;
157156
const size_t bytePerSample = audioBuffer.getBytesPerSample();
157+
const int dstNbChannels = channelIndexArray.size();
158158
const int noAlignment = 0;
159159
const size_t decodedSize = av_samples_get_buffer_size(NULL, dstNbChannels, frameBuffer.getAVFrame().nb_samples,
160160
avCodecContext.sample_fmt, noAlignment);

0 commit comments

Comments
 (0)