Put the default sample rates back, might be causing bad init..

This commit is contained in:
Charles J. Cliffe 2015-10-21 16:56:32 -04:00
parent 0cad2f1cfa
commit cd82ecb15b
5 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8)
SET(CUBICSDR_VERSION_MAJOR "0") SET(CUBICSDR_VERSION_MAJOR "0")
SET(CUBICSDR_VERSION_MINOR "1") SET(CUBICSDR_VERSION_MINOR "1")
SET(CUBICSDR_VERSION_PATCH "11") SET(CUBICSDR_VERSION_PATCH "12")
SET(CUBICSDR_VERSION_REL "alpha") SET(CUBICSDR_VERSION_REL "alpha")
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}") SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}")

View File

@ -112,9 +112,9 @@ long long strToFrequency(std::string freqStr) {
} }
CubicSDR::CubicSDR() : appframe(NULL), m_glContext(NULL), frequency(0), offset(0), ppm(0), snap(1), sampleRate(0), directSamplingMode(0), CubicSDR::CubicSDR() : appframe(NULL), m_glContext(NULL), frequency(0), offset(0), ppm(0), snap(1), sampleRate(DEFAULT_SAMPLE_RATE), directSamplingMode(0),
sdrThread(NULL), sdrPostThread(NULL), spectrumVisualThread(NULL), demodVisualThread(NULL), pipeSDRIQData(NULL), pipeIQVisualData(NULL), pipeAudioVisualData(NULL), t_SDR(NULL), t_PostSDR(NULL) { sdrThread(NULL), sdrPostThread(NULL), spectrumVisualThread(NULL), demodVisualThread(NULL), pipeSDRIQData(NULL), pipeIQVisualData(NULL), pipeAudioVisualData(NULL), t_SDR(NULL), t_PostSDR(NULL) {
sampleRateInitialized.store(false);
} }
@ -412,8 +412,9 @@ void CubicSDR::setDevice(SDRDeviceInfo *dev) {
// } // }
// Try for a reasonable default sample rate. // Try for a reasonable default sample rate.
if (!sampleRate) { if (!sampleRateInitialized.load()) {
sampleRate = chan->getSampleRateNear(DEFAULT_SAMPLE_RATE); sampleRate = chan->getSampleRateNear(DEFAULT_SAMPLE_RATE);
sampleRateInitialized.store(true);
} }
int rateHigh, rateLow; int rateHigh, rateLow;

View File

@ -142,6 +142,7 @@ private:
std::thread *t_SDR, *t_SDREnum, *t_PostSDR, *t_SpectrumVisual, *t_DemodVisual; std::thread *t_SDR, *t_SDREnum, *t_PostSDR, *t_SpectrumVisual, *t_DemodVisual;
std::atomic_bool devicesReady; std::atomic_bool devicesReady;
std::atomic_bool deviceSelectorOpen; std::atomic_bool deviceSelectorOpen;
std::atomic_bool sampleRateInitialized;
std::string notifyMessage; std::string notifyMessage;
std::mutex notify_busy; std::mutex notify_busy;
}; };

View File

@ -11,7 +11,7 @@ SDRThread::SDRThread() : IOThread() {
deviceConfig.store(NULL); deviceConfig.store(NULL);
deviceInfo.store(NULL); deviceInfo.store(NULL);
sampleRate.store(0); sampleRate.store(DEFAULT_SAMPLE_RATE);
frequency.store(0); frequency.store(0);
offset.store(0); offset.store(0);
ppm.store(0); ppm.store(0);

View File

@ -22,7 +22,7 @@ public:
std::vector<liquid_float_complex> data; std::vector<liquid_float_complex> data;
SDRThreadIQData() : SDRThreadIQData() :
frequency(0), sampleRate(0), dcCorrected(true), numChannels(0) { frequency(0), sampleRate(DEFAULT_SAMPLE_RATE), dcCorrected(true), numChannels(0) {
} }