From: Stefan BrĂ¼ns Date: Sun, 29 Nov 2015 04:30:33 +0000 (+0100) Subject: view/analogsignal: set samplerate to 1.0 if samplerate is not known X-Git-Tag: pulseview-0.3.0~33 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=69e33a1b71599bbe35176ef7a77b58793a7d6ca2;p=pulseview.git view/analogsignal: set samplerate to 1.0 if samplerate is not known This fixes parts of bug #387. --- diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 218a959d..683757d1 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -128,7 +128,7 @@ void AnalogSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp) segments.front(); const double pixels_offset = pp.pixels_offset(); - const double samplerate = segment->samplerate(); + const double samplerate = max(1.0, segment->samplerate()); const pv::util::Timestamp& start_time = segment->start_time(); const int64_t last_sample = segment->get_sample_count() - 1; const double samples_per_pixel = samplerate * pp.scale();