@@ -116,7 +116,7 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer)
116
116
return decodeNextFrame;
117
117
}
118
118
119
- bool AudioDecoder::decodeNextFrame (Frame& frameBuffer, const std::vector<size_t > channelsIndex )
119
+ bool AudioDecoder::decodeNextFrame (Frame& frameBuffer, const std::vector<size_t > channelIndexArray )
120
120
{
121
121
AudioFrame& audioBuffer = static_cast <AudioFrame&>(frameBuffer);
122
122
@@ -137,7 +137,7 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer, const std::vector<size_t>
137
137
return false ;
138
138
139
139
// check if each expected channel exists
140
- for (std::vector<size_t >::const_iterator channelIndex = channelsIndex .begin (); channelIndex != channelsIndex .end (); ++channelIndex)
140
+ for (std::vector<size_t >::const_iterator channelIndex = channelIndexArray .begin (); channelIndex != channelIndexArray .end (); ++channelIndex)
141
141
{
142
142
if ((*channelIndex) > srcNbChannels - 1 )
143
143
{
@@ -153,8 +153,8 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer, const std::vector<size_t>
153
153
154
154
// copy frame properties of decoded frame
155
155
audioBuffer.copyProperties (allDataOfNextFrame);
156
- av_frame_set_channels (&audioBuffer.getAVFrame (), channelsIndex .size ());
157
- av_frame_set_channel_layout (&audioBuffer.getAVFrame (), av_get_default_channel_layout (channelsIndex .size ()));
156
+ av_frame_set_channels (&audioBuffer.getAVFrame (), channelIndexArray .size ());
157
+ av_frame_set_channel_layout (&audioBuffer.getAVFrame (), av_get_default_channel_layout (channelIndexArray .size ()));
158
158
audioBuffer.setNbSamplesPerChannel (allDataOfNextFrame.getNbSamplesPerChannel ());
159
159
160
160
// @todo manage cases with data of frame not only on data[0] (use _frame.linesize)
@@ -165,20 +165,20 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer, const std::vector<size_t>
165
165
for (size_t sample = 0 ; sample < allDataOfNextFrame.getNbSamplesPerChannel (); ++sample)
166
166
{
167
167
// offset in source buffer
168
- src += channelsIndex .at (0 ) * bytePerSample;
168
+ src += channelIndexArray .at (0 ) * bytePerSample;
169
169
170
- for (size_t i = 0 ; i < channelsIndex .size (); ++i)
170
+ for (size_t i = 0 ; i < channelIndexArray .size (); ++i)
171
171
{
172
172
memcpy (dst, src, bytePerSample);
173
173
dst += bytePerSample;
174
174
175
175
// shift to the corresponding sample in the next channel of the current layout
176
- if (i < channelsIndex .size () - 1 )
177
- src += (channelsIndex .at (i+1 ) - channelsIndex .at (i)) * bytePerSample;
176
+ if (i < channelIndexArray .size () - 1 )
177
+ src += (channelIndexArray .at (i+1 ) - channelIndexArray .at (i)) * bytePerSample;
178
178
// else shift to the next layout
179
179
else
180
180
{
181
- src += (srcNbChannels - channelsIndex .at (i)) * bytePerSample;
181
+ src += (srcNbChannels - channelIndexArray .at (i)) * bytePerSample;
182
182
break ;
183
183
}
184
184
}
0 commit comments