From 28b4d72982cba74d04a8a5fc833d85eb538468a8 Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Tue, 27 Jun 2023 13:06:58 -0700 Subject: [PATCH] [nplb] Increase max pending buffers in resampler Increase kMaximumPendingBuffers in InterleavedSincResampler to fix failed partial audio tests. b/274020873 b/289102877 --- .../starboard/player/filter/interleaved_sinc_resampler.cc | 3 +++ .../starboard/player/filter/interleaved_sinc_resampler.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.cc b/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.cc index 86f21eb13acc..4ad94f13434d 100644 --- a/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.cc +++ b/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.cc @@ -235,6 +235,9 @@ void InterleavedSincResampler::Flush() { } bool InterleavedSincResampler::CanQueueBuffer() const { + // TODO(b/289102877): after support partial audio, each input buffer could + // have a small amount of frames. We should avoid using count of pending + // buffer here. if (pending_buffers_.empty()) { return true; } diff --git a/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.h b/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.h index 29974b0e4d44..2bf75db4756a 100644 --- a/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.h +++ b/starboard/shared/starboard/player/filter/interleaved_sinc_resampler.h @@ -109,7 +109,7 @@ class InterleavedSincResampler { static const int kBufferSize = kBlockSize + kKernelSize; // The maximum numbers of buffer can be queued. - static const int kMaximumPendingBuffers = 8; + static const int kMaximumPendingBuffers = 16; static const int kMaxChannels = 8; static const int kInputBufferSize = kMaxChannels * kBufferSize;