Skip to content

Commit d2c8e12

Browse files
author
Clement Champetier
committed
InputAudio: refactoring - rename local variable
Rename nbChannels to nbSubStreams.
1 parent e42802f commit d2c8e12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/AvTranscoder/EssenceStream/InputAudio.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ bool InputAudio::readNextFrame( Frame& frameBuffer, const size_t subStreamIndex
143143
const int output_align = 1;
144144
size_t decodedSize = av_samples_get_buffer_size(NULL, output_nbChannels, _frame->nb_samples, _codecContext->sample_fmt, output_align);
145145

146-
size_t nbChannels = _codecContext->channels;
146+
size_t nbSubStreams = _codecContext->channels;
147147
size_t bytePerSample = av_get_bytes_per_sample( (AVSampleFormat)_frame->format );
148148

149-
if( subStreamIndex > nbChannels - 1 )
149+
if( subStreamIndex > nbSubStreams - 1 )
150150
{
151151
throw std::runtime_error( "The subStream doesn't exist");
152152
}
@@ -164,7 +164,7 @@ bool InputAudio::readNextFrame( Frame& frameBuffer, const size_t subStreamIndex
164164
unsigned char* dst = audioBuffer.getPtr();
165165

166166
// offset
167-
src += ( nbChannels - 1 - subStreamIndex ) * bytePerSample;
167+
src += ( nbSubStreams - 1 - subStreamIndex ) * bytePerSample;
168168

169169
for( int sample = 0; sample < _frame->nb_samples; ++sample )
170170
{
@@ -173,7 +173,7 @@ bool InputAudio::readNextFrame( Frame& frameBuffer, const size_t subStreamIndex
173173
// std::cout << "dst " << static_cast<void *>(dst) << std::endl;
174174
memcpy( dst, src, bytePerSample );
175175
dst += bytePerSample;
176-
src += bytePerSample * nbChannels;
176+
src += bytePerSample * nbSubStreams;
177177
}
178178
}
179179
return true;

0 commit comments

Comments
 (0)