From: Soeren Apel Date: Fri, 10 Feb 2017 07:09:55 +0000 (+0100) Subject: Session: Handle frame markers properly X-Git-Tag: pulseview-0.4.0~195 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0a4162a4bd844574319f8b26b05f4fcdf837bb70;p=pulseview.git Session: Handle frame markers properly --- diff --git a/pv/session.cpp b/pv/session.cpp index 42c581d4..df09ff3b 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -1031,6 +1031,8 @@ void Session::feed_in_analog(shared_ptr analog) void Session::data_feed_in(shared_ptr device, shared_ptr packet) { + static bool frame_began=false; + (void)device; assert(device); @@ -1052,6 +1054,7 @@ void Session::data_feed_in(shared_ptr device, case SR_DF_FRAME_BEGIN: feed_in_frame_begin(); + frame_began = true; break; case SR_DF_LOGIC: @@ -1072,6 +1075,7 @@ void Session::data_feed_in(shared_ptr device, } break; + case SR_DF_FRAME_END: case SR_DF_END: { { @@ -1079,7 +1083,10 @@ void Session::data_feed_in(shared_ptr device, cur_logic_segment_.reset(); cur_analog_segments_.clear(); } - frame_ended(); + if (frame_began) { + frame_began = false; + frame_ended(); + } break; } default: