mirror of
				https://github.com/AlexandreRouma/SDRPlusPlus.git
				synced 2025-11-04 10:49:11 +01:00 
			
		
		
		
	Fixedd buffer overflow in audio IO
This commit is contained in:
		@@ -39,7 +39,7 @@ namespace io {
 | 
			
		||||
            outputParams.hostApiSpecificStreamInfo = NULL;
 | 
			
		||||
            outputParams.device = Pa_GetDefaultOutputDevice();
 | 
			
		||||
            outputParams.suggestedLatency = Pa_GetDeviceInfo(outputParams.device)->defaultLowOutputLatency;
 | 
			
		||||
            PaError err = Pa_OpenStream(&stream, NULL, &outputParams, 48000.0f, 64, paClipOff, _callback, this);
 | 
			
		||||
            PaError err = Pa_OpenStream(&stream, NULL, &outputParams, 48000.0f, _bufferSize, paClipOff, _callback, this);
 | 
			
		||||
            printf("%s\n", Pa_GetErrorText(err));
 | 
			
		||||
            err = Pa_StartStream(stream);
 | 
			
		||||
            printf("%s\n", Pa_GetErrorText(err));
 | 
			
		||||
@@ -67,13 +67,8 @@ namespace io {
 | 
			
		||||
            
 | 
			
		||||
            float vol = powf(_this->_volume, 2);
 | 
			
		||||
            for (int i = 0; i < frameCount; i++) {
 | 
			
		||||
 | 
			
		||||
                
 | 
			
		||||
                outbuf[(i * 2) + 0] = _this->buffer[i] * vol;
 | 
			
		||||
                outbuf[(i * 2) + 1] = _this->buffer[i] * vol;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -43,6 +43,10 @@ namespace io {
 | 
			
		||||
            
 | 
			
		||||
            devList = SoapySDR::Device::enumerate();
 | 
			
		||||
            txtDevList = "";
 | 
			
		||||
            if (devList.size() == 0) {
 | 
			
		||||
                txtDevList += '\0';
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            for (int i = 0; i < devList.size(); i++) {
 | 
			
		||||
                txtDevList += devList[i]["label"];
 | 
			
		||||
                txtDevList += '\0';
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ void SignalPath::init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream
 | 
			
		||||
    ssbDemod.init(mainVFO.output, 6000, 3000, 22);
 | 
			
		||||
    
 | 
			
		||||
    audioResamp.init(&demod.output, 200000, 48000, 800);
 | 
			
		||||
    audio.init(&audioResamp.output, 16);
 | 
			
		||||
    audio.init(&audioResamp.output, 64);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SignalPath::setSampleRate(float sampleRate) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user