summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorRandell Jesup <rjesup@jesup.org>2018-04-05 17:15:07 -0400
committerwolfbeast <mcwerewolf@gmail.com>2018-04-19 11:57:36 +0200
commitd66d343e1b6a5c3be08f82a0ac2489a91c647d65 (patch)
tree7014dd838069f2f48b9d0607bf380de8cb9f97de /dom
parent3cf71e45130b161ff5e3412898babfe13dec4bbf (diff)
downloadUXP-d66d343e1b6a5c3be08f82a0ac2489a91c647d65.tar
UXP-d66d343e1b6a5c3be08f82a0ac2489a91c647d65.tar.gz
UXP-d66d343e1b6a5c3be08f82a0ac2489a91c647d65.tar.lz
UXP-d66d343e1b6a5c3be08f82a0ac2489a91c647d65.tar.xz
UXP-d66d343e1b6a5c3be08f82a0ac2489a91c647d65.zip
Bug 1448705 - Use input latency for draining. r=jya, a=RyanVM
--HG-- extra : source : b2904f128f854a71216f299b835da5a422ceb3cd extra : intermediate-source : eae4410ea11d83feed90ca9d3b6bd5a9c67c17a7
Diffstat (limited to 'dom')
-rw-r--r--dom/media/AudioConverter.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/dom/media/AudioConverter.cpp b/dom/media/AudioConverter.cpp
index 77ad46ec6..25b981f43 100644
--- a/dom/media/AudioConverter.cpp
+++ b/dom/media/AudioConverter.cpp
@@ -362,15 +362,13 @@ size_t
AudioConverter::ResampleRecipientFrames(size_t aFrames) const
{
if (!aFrames && mIn.Rate() != mOut.Rate()) {
- // The resampler will be drained, account for frames currently buffered
- // in the resampler.
if (!mResampler) {
return 0;
}
- return speex_resampler_get_output_latency(mResampler);
- } else {
- return (uint64_t)aFrames * mOut.Rate() / mIn.Rate() + 1;
+ // We drain by pushing in get_input_latency() samples of 0
+ aFrames = speex_resampler_get_input_latency(mResampler);
}
+ return (uint64_t)aFrames * mOut.Rate() / mIn.Rate() + 1;
}
size_t