Error in update of read index in ACM
Fixing a bug where we increase read index with too few samples when the input is stereo. BUG=https://code.google.com/p/webrtc/issues/detail?id=714 R=andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1753004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4290 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -303,8 +303,7 @@ int16_t ACMGenericCodec::Encode(uint8_t* bitstream,
|
|||||||
|
|
||||||
// Reset the variables which will be incremented in the loop.
|
// Reset the variables which will be incremented in the loop.
|
||||||
*bitstream_len_byte = 0;
|
*bitstream_len_byte = 0;
|
||||||
bool done = false;
|
do {
|
||||||
while (!done) {
|
|
||||||
status = InternalEncode(&bitstream[*bitstream_len_byte],
|
status = InternalEncode(&bitstream[*bitstream_len_byte],
|
||||||
&tmp_bitstream_len_byte);
|
&tmp_bitstream_len_byte);
|
||||||
*bitstream_len_byte += tmp_bitstream_len_byte;
|
*bitstream_len_byte += tmp_bitstream_len_byte;
|
||||||
@@ -323,12 +322,7 @@ int16_t ACMGenericCodec::Encode(uint8_t* bitstream,
|
|||||||
// break from the loop
|
// break from the loop
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} while (in_audio_ix_read_ < frame_len_smpl_ * num_channels_);
|
||||||
// TODO(andrew): This should be multiplied by the number of
|
|
||||||
// channels, right?
|
|
||||||
// http://code.google.com/p/webrtc/issues/detail?id=714
|
|
||||||
done = in_audio_ix_read_ >= frame_len_smpl_;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
*encoding_type = (vad_label_[0] == 1) ? kActiveNormalEncoded :
|
*encoding_type = (vad_label_[0] == 1) ? kActiveNormalEncoded :
|
||||||
|
|||||||
Reference in New Issue
Block a user