projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
manpage: Drop obsolete -s|--log-to-stdout docs.
[pulseview.git]
/
pv
/
session.cpp
diff --git
a/pv/session.cpp
b/pv/session.cpp
index fba49be8900139f5405b7e4f6d461d235004aa8f..5356433f9027e8fa5298db01dff5256d8a28a674 100644
(file)
--- a/
pv/session.cpp
+++ b/
pv/session.cpp
@@
-950,7
+950,11
@@
void Session::sample_thread_proc(function<void (const QString)> error_handler)
if (!device_)
return;
if (!device_)
return;
- cur_samplerate_ = device_->read_config<uint64_t>(ConfigKey::SAMPLERATE);
+ try {
+ cur_samplerate_ = device_->read_config<uint64_t>(ConfigKey::SAMPLERATE);
+ } catch (Error& e) {
+ cur_samplerate_ = 0;
+ }
out_of_memory_ = false;
out_of_memory_ = false;
@@
-1161,7
+1165,11
@@
void Session::feed_in_logic(shared_ptr<Logic> logic)
}
if (!cur_samplerate_)
}
if (!cur_samplerate_)
- cur_samplerate_ = device_->read_config<uint64_t>(ConfigKey::SAMPLERATE);
+ try {
+ cur_samplerate_ = device_->read_config<uint64_t>(ConfigKey::SAMPLERATE);
+ } catch (Error& e) {
+ // Do nothing
+ }
lock_guard<recursive_mutex> lock(data_mutex_);
lock_guard<recursive_mutex> lock(data_mutex_);
@@
-1198,16
+1206,18
@@
void Session::feed_in_analog(shared_ptr<Analog> analog)
}
if (!cur_samplerate_)
}
if (!cur_samplerate_)
- cur_samplerate_ = device_->read_config<uint64_t>(ConfigKey::SAMPLERATE);
+ try {
+ cur_samplerate_ = device_->read_config<uint64_t>(ConfigKey::SAMPLERATE);
+ } catch (Error& e) {
+ // Do nothing
+ }
lock_guard<recursive_mutex> lock(data_mutex_);
const vector<shared_ptr<Channel>> channels = analog->channels();
lock_guard<recursive_mutex> lock(data_mutex_);
const vector<shared_ptr<Channel>> channels = analog->channels();
- const unsigned int channel_count = channels.size();
- const size_t sample_count = analog->num_samples() / channel_count;
bool sweep_beginning = false;
bool sweep_beginning = false;
- unique_ptr<float[]> data(new float[analog->num_samples()]);
+ unique_ptr<float[]> data(new float[analog->num_samples()
* channels.size()
]);
analog->get_data_as_float(data.get());
if (signalbases_.empty())
analog->get_data_as_float(data.get());
if (signalbases_.empty())
@@
-1249,8
+1259,8
@@
void Session::feed_in_analog(shared_ptr<Analog> analog)
assert(segment);
// Append the samples in the segment
assert(segment);
// Append the samples in the segment
- segment->append_interleaved_samples(channel_data++,
sample_count
,
- channel
_count
);
+ segment->append_interleaved_samples(channel_data++,
analog->num_samples()
,
+ channel
s.size()
);
}
if (sweep_beginning) {
}
if (sweep_beginning) {