| Index: media/audio/pulse/pulse_input.cc
|
| diff --git a/media/audio/pulse/pulse_input.cc b/media/audio/pulse/pulse_input.cc
|
| index b9d91c6a679d501c194a7d57c8c993839baf3384..13d8eab39fd439656759cde50fef377b7a37e466 100644
|
| --- a/media/audio/pulse/pulse_input.cc
|
| +++ b/media/audio/pulse/pulse_input.cc
|
| @@ -270,6 +270,15 @@ void PulseAudioInputStream::ReadData() {
|
| break;
|
|
|
| const int number_of_frames = length / params_.GetBytesPerFrame();
|
| + if (number_of_frames > fifo_.GetUnfilledFrames()) {
|
| + // Dynamically append buffers to the FIFO to handle larger buffer got
|
| + // from Pulse.
|
| + const int append_blocks_of_buffer = static_cast<int>(
|
| + (number_of_frames - fifo_.GetUnfilledFrames()) /
|
| + params_.frames_per_buffer()) + 1;
|
| + fifo_.Append(append_blocks_of_buffer);
|
| + }
|
| +
|
| fifo_.Push(data, number_of_frames, params_.bits_per_sample() / 8);
|
|
|
| // Checks if we still have data.
|
|
|