Bug 803881: Fix wrong number of samples for webrtc media unit tests r=ekr

This commit is contained in:
Randell Jesup 2012-10-24 16:54:33 -04:00
parent 340b17efe3
commit e20b9edb57

View File

@ -270,13 +270,14 @@ void AudioSendAndReceive::GenerateAndReadSamples()
int16_t audioOutput[PLAYOUT_SAMPLE_LENGTH];
short* inbuf;
int sampleLengthDecoded = 0;
int SAMPLES = PLAYOUT_SAMPLE_FREQUENCY * 10; //10 milliseconds
int SAMPLES = (PLAYOUT_SAMPLE_FREQUENCY * 10)/1000; //10 milliseconds
int CHANNELS = 1; //mono audio
int sampleLengthInBytes = PLAYOUT_SAMPLE_LENGTH * sizeof(short);
int sampleLengthInBytes = sizeof(audioInput);
//generated audio buffer
inbuf = (short *)moz_xmalloc(sizeof(short)*SAMPLES*CHANNELS);
memset(audioInput,0,sampleLengthInBytes);
memset(audioOutput,0,sampleLengthInBytes);
MOZ_ASSERT(SAMPLES <= PLAYOUT_SAMPLE_LENGTH);
FILE* inFile = fopen( iFile.c_str(), "wb+");
if(!inFile) {