mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 867174 - Part 1: Deliver the correct channel count the to the resampler the first time that we see a buffer; r=padenot
This commit is contained in:
parent
954cd4dfaa
commit
74ef44fd2d
@ -304,7 +304,7 @@ public:
|
||||
mSampleRate == IdealAudioRate());
|
||||
}
|
||||
|
||||
void UpdateSampleRateIfNeeded(AudioNodeStream* aStream)
|
||||
void UpdateSampleRateIfNeeded(AudioNodeStream* aStream, uint32_t aChannels)
|
||||
{
|
||||
if (mPlaybackRateTimeline.HasSimpleValue()) {
|
||||
mPlaybackRate = mPlaybackRateTimeline.GetValue();
|
||||
@ -319,7 +319,7 @@ public:
|
||||
|
||||
uint32_t currentOutSampleRate, currentInSampleRate;
|
||||
if (ShouldResample()) {
|
||||
SpeexResamplerState* resampler = Resampler(mChannels);
|
||||
SpeexResamplerState* resampler = Resampler(aChannels);
|
||||
speex_resampler_get_rate(resampler, ¤tInSampleRate, ¤tOutSampleRate);
|
||||
uint32_t finalSampleRate = ComputeFinalOutSampleRate();
|
||||
if (currentOutSampleRate != finalSampleRate) {
|
||||
@ -345,7 +345,7 @@ public:
|
||||
// WebKit treats the playbackRate as a k-rate parameter in their code,
|
||||
// despite the spec saying that it should be an a-rate parameter. We treat
|
||||
// it as k-rate. Spec bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=21592
|
||||
UpdateSampleRateIfNeeded(aStream);
|
||||
UpdateSampleRateIfNeeded(aStream, channels);
|
||||
|
||||
uint32_t written = 0;
|
||||
TrackTicks currentPosition = GetPosition(aStream);
|
||||
|
Loading…
Reference in New Issue
Block a user