projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f81a39
)
pv::view::View::get_time_extents: Assume samplerate is 1 if given an invalid value
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Fri, 17 Jan 2014 18:41:31 +0000
(18:41 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Fri, 17 Jan 2014 18:50:52 +0000
(18:50 +0000)
Fixes #278
pv/view/view.cpp
patch
|
blob
|
history
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index a437918d9f2a88f3001f35ae9eb33b854530924c..35195b58dc150c8743f5d623e7495ccb1ecd5412 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-286,9
+286,12
@@
pair<double, double> View::get_time_extents() const
BOOST_FOREACH(const shared_ptr<SignalData> d, visible_data)
{
const double start_time = d->get_start_time();
+ double samplerate = d->samplerate();
+ samplerate = (samplerate <= 0.0) ? 1.0 : samplerate;
+
left_time = min(left_time, start_time);
right_time = max(right_time, start_time +
- d->get_max_sample_count() /
d->samplerate()
);
+ d->get_max_sample_count() /
samplerate
);
}
assert(left_time < right_time);