]> sigrok.org Git - pulseview.git/commitdiff
view/analogsignal: set samplerate to 1.0 if samplerate is not known
authorStefan Brüns <redacted>
Sun, 29 Nov 2015 04:30:33 +0000 (05:30 +0100)
committerUwe Hermann <redacted>
Mon, 21 Dec 2015 14:38:36 +0000 (15:38 +0100)
This fixes parts of bug #387.

pv/view/analogsignal.cpp

index 218a959dd422aed5e6560398bb436a85b86317d5..683757d1a52cffc1f781bee07d73ca3b16f8b43c 100644 (file)
@@ -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();