if (ds->decode_interrupt_)
return;
+ if (ds->segments_.empty())
+ return;
+
lock_guard<mutex> lock(ds->output_mutex_);
// Get the decoder and the annotation data
void View::on_selected_decoder_changed(int index)
{
- if (signal_)
+ if (signal_) {
disconnect(signal_, SIGNAL(new_annotations()));
+ disconnect(signal_, SIGNAL(decode_reset()));
+ }
reset_data();
if (decoder_ == dec.get())
signal_ = ds.get();
- if (signal_)
+ if (signal_) {
connect(signal_, SIGNAL(new_annotations()), this, SLOT(on_new_annotations()));
+ connect(signal_, SIGNAL(decode_reset()), this, SLOT(on_decoder_reset()));
+ }
update_data();
}
delayed_view_updater_.start();
}
+void View::on_decoder_reset()
+{
+ // Invalidate the model's data connection immediately - otherwise we
+ // will use a stale pointer in model_->index() when called from the table view
+ model_->set_signal_and_segment(signal_, current_segment_);
+}
+
void View::on_decoder_stacked(void* decoder)
{
Decoder* d = static_cast<Decoder*>(decoder);
void on_signal_name_changed(const QString &name);
void on_new_annotations();
+ void on_decoder_reset();
void on_decoder_stacked(void* decoder);
void on_decoder_removed(void* decoder);