X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fdecodesignal.cpp;h=640e58148ef751e3aa7557dca2d7af5d526c2240;hb=9431e2d3d256f3602c3637847a8ec3ad3fdcd590;hp=ed29cafe45ac4cde4202fcb144f56c7f89437866;hpb=69e950969e45ddbf516069c28f72f5696c53af5d;p=pulseview.git diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index ed29cafe..640e5814 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -308,7 +308,13 @@ void DecodeSignal::auto_assign_signals(const shared_ptr dec) } } - if (match) { + // Prevent using a signal more than once as D1 would match e.g. D1 and D10 + bool signal_not_already_used = true; + for (decode::DecodeChannel& ch : channels_) + if (ch.assigned_signal && (ch.assigned_signal == match)) + signal_not_already_used = false; + + if (match && signal_not_already_used) { ch.assigned_signal = match; new_assignment = true; } @@ -1167,14 +1173,12 @@ void DecodeSignal::logic_mux_proc() logic_mux_data_->push_segment(output_segment); output_segment->set_samplerate(get_input_samplerate(segment_id)); + } else { + // Wait for more input data if we're processing the currently last segment + unique_lock logic_mux_lock(logic_mux_mutex_); + logic_mux_cond_.wait(logic_mux_lock); } } - - if (segment_id == (get_input_segment_count() - 1)) { - // Wait for more input data if we're processing the currently last segment - unique_lock logic_mux_lock(logic_mux_mutex_); - logic_mux_cond_.wait(logic_mux_lock); - } } } while (!logic_mux_interrupt_); } @@ -1299,14 +1303,13 @@ void DecodeSignal::decode_proc() // All segments have been processed if (!decode_interrupt_) decode_finished(); + + // Wait for more input data + unique_lock input_wait_lock(input_mutex_); + decode_input_cond_.wait(input_wait_lock); } } - if (current_segment_id_ == (logic_mux_data_->logic_segments().size() - 1)) { - // Wait for more input data if we're processing the currently last segment - unique_lock input_wait_lock(input_mutex_); - decode_input_cond_.wait(input_wait_lock); - } } } while (!decode_interrupt_); }