]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decoderstack.cpp
Check required probes before starting the decode thread
[pulseview.git] / pv / data / decoderstack.cpp
index 8284c7937c7a7ee6a68f334a587bee7374e97fcb..c197e019fd16c6b1e1d5d35ff2aa02d62b9e2bfa 100644 (file)
@@ -193,6 +193,14 @@ void DecoderStack::begin_decode()
 
        clear();
 
+       // Check that all decoders have the required probes
+       BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
+               if (!dec->have_required_probes()) {
+                       _error_message = tr("One or more required probes "
+                               "have not been specified");
+                       return;
+               }
+
        // Add classes
        BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec, _stack)
        {
@@ -320,11 +328,6 @@ void DecoderStack::decode_proc()
        assert(data);
        assert(_snapshot);
 
-       // Check that all decoders have the required probes
-       BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
-               if (!dec->have_required_probes())
-                       return;
-
        // Create the session
        srd_session_new(&session);
        assert(session);