X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fsigsession.cpp;h=b2670b6fbfcc908089ae7cc5b52704773ac33db3;hb=c0d6d47981e7749319894a82a2400a5f0c0711b8;hp=11ba6b068a180df0cb281c94a577ef7329d070de;hpb=94fe58efe521284904f7cddf2c8f833c2b8d48e8;p=pulseview.git diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 11ba6b0..b2670b6 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -72,13 +72,13 @@ SigSession::capture_state SigSession::get_capture_state() const } void SigSession::start_capture(struct sr_dev_inst *sdi, - uint64_t record_length, uint64_t sample_rate) + uint64_t record_length) { stop_capture(); _sampling_thread.reset(new boost::thread( &SigSession::sample_thread_proc, this, sdi, - record_length, sample_rate)); + record_length)); } void SigSession::stop_capture() @@ -135,7 +135,7 @@ void SigSession::load_thread_proc(const string name) } void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, - uint64_t record_length, uint64_t sample_rate) + uint64_t record_length) { assert(sdi); @@ -156,14 +156,6 @@ void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, return; } - // Set the samplerate - if (sr_config_set(sdi, SR_CONF_SAMPLERATE, - &sample_rate) != SR_OK) { - qDebug() << "Failed to configure samplerate."; - sr_session_destroy(); - return; - } - if (sr_session_start() != SR_OK) { qDebug() << "Failed to start session."; return; @@ -180,7 +172,7 @@ void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, void SigSession::feed_in_header(const sr_dev_inst *sdi) { shared_ptr signal; - uint64_t *sample_rate; + uint64_t *sample_rate = NULL; unsigned int logic_probe_count = 0; unsigned int analog_probe_count = 0; @@ -203,8 +195,10 @@ void SigSession::feed_in_header(const sr_dev_inst *sdi) // Read out the sample rate assert(sdi->driver); - assert(sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, - (const void**)&sample_rate, sdi) == SR_OK); + + const int ret = sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, + (const void**)&sample_rate, sdi); + assert(ret == SR_OK); // Create data containers for the coming data snapshots {