]> sigrok.org Git - pulseview.git/commitdiff
Session: Handle frame markers properly
authorSoeren Apel <redacted>
Fri, 10 Feb 2017 07:09:55 +0000 (08:09 +0100)
committerSoeren Apel <redacted>
Fri, 10 Feb 2017 07:09:55 +0000 (08:09 +0100)
pv/session.cpp

index 42c581d420122fd126fc9e7fb7d51b11f3b34648..df09ff3b2ebc0b924a9158158de9a2362ab385db 100644 (file)
@@ -1031,6 +1031,8 @@ void Session::feed_in_analog(shared_ptr<Analog> analog)
 void Session::data_feed_in(shared_ptr<sigrok::Device> device,
        shared_ptr<Packet> packet)
 {
+       static bool frame_began=false;
+
        (void)device;
 
        assert(device);
@@ -1052,6 +1054,7 @@ void Session::data_feed_in(shared_ptr<sigrok::Device> 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<sigrok::Device> device,
                }
                break;
 
+       case SR_DF_FRAME_END:
        case SR_DF_END:
        {
                {
@@ -1079,7 +1083,10 @@ void Session::data_feed_in(shared_ptr<sigrok::Device> device,
                        cur_logic_segment_.reset();
                        cur_analog_segments_.clear();
                }
-               frame_ended();
+               if (frame_began) {
+                       frame_began = false;
+                       frame_ended();
+               }
                break;
        }
        default: