зеркало из https://github.com/mozilla/gecko-dev.git
Bug 846329 - Fix decodeAudioData to decode all channels and not only the first one; r=padenot
This commit is contained in:
Родитель
531ed4f366
Коммит
0343d8a94f
|
@ -538,11 +538,11 @@ MediaDecodeTask::CopyBuffer()
|
|||
uint32_t outSamples = expectedOutSamples;
|
||||
|
||||
#ifdef MOZ_SAMPLE_TYPE_S16
|
||||
speex_resampler_process_int(resampler, i, bufferData, &inSamples,
|
||||
speex_resampler_process_int(resampler, i, &bufferData[i * audioData->mFrames], &inSamples,
|
||||
&resampledBuffer[i * expectedOutSamples],
|
||||
&outSamples);
|
||||
#else
|
||||
speex_resampler_process_float(resampler, i, bufferData, &inSamples,
|
||||
speex_resampler_process_float(resampler, i, &bufferData[i * audioData->mFrames], &inSamples,
|
||||
&resampledBuffer[i * expectedOutSamples],
|
||||
&outSamples);
|
||||
#endif
|
||||
|
|
|
@ -29,6 +29,10 @@ MOCHITEST_FILES := \
|
|||
test_singleSourceDest.html \
|
||||
ting.ogg \
|
||||
ting-expected.wav \
|
||||
ting-dualchannel44.1.ogg \
|
||||
ting-dualchannel44.1-expected.wav \
|
||||
ting-dualchannel48.ogg \
|
||||
ting-dualchannel48-expected.wav \
|
||||
small-shot.ogg \
|
||||
small-shot-expected.wav \
|
||||
invalid.txt \
|
||||
|
|
|
@ -123,6 +123,28 @@ var tests = [
|
|||
fuzzTolerance: 12,
|
||||
fuzzToleranceMobile: 15826
|
||||
},
|
||||
// An ogg file with two different channels, 44.1khz
|
||||
{
|
||||
url: "ting-dualchannel44.1.ogg",
|
||||
valid: true,
|
||||
expected: "ting-dualchannel44.1-expected.wav",
|
||||
numberOfChannels: 2,
|
||||
duration: 0.6936,
|
||||
length: 33297,
|
||||
fuzzTolerance: 16,
|
||||
fuzzToleranceMobile: 16713
|
||||
},
|
||||
// An ogg file with two different channels, 48khz
|
||||
{
|
||||
url: "ting-dualchannel48.ogg",
|
||||
valid: true,
|
||||
expected: "ting-dualchannel48-expected.wav",
|
||||
numberOfChannels: 2,
|
||||
duration: 0.6373,
|
||||
length: 30592,
|
||||
fuzzTolerance: 9,
|
||||
fuzzToleranceMobile: 2703
|
||||
},
|
||||
// An ogg file which needs to be resampled
|
||||
{
|
||||
url: "small-shot.ogg",
|
||||
|
@ -148,8 +170,8 @@ var tests = [
|
|||
numberOfChannels: 2,
|
||||
duration: 1.0811,
|
||||
length: 51896,
|
||||
fuzzTolerance: 132,
|
||||
fuzzToleranceMobile: 56580
|
||||
fuzzTolerance: 91427,
|
||||
fuzzToleranceMobile: 119684
|
||||
},
|
||||
// Make sure decoding a wave file results in the same buffer
|
||||
{
|
||||
|
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче