+ const shared_ptr<pv::data::LogicSnapshot> &snapshot =
+ snapshots.front();
+ const int64_t sample_count = snapshot->get_sample_count() - 1;
+
+ // Create the session
+ srd_session_new(&session);
+ assert(session);
+
+ srd_session_metadata_set(session, SRD_CONF_SAMPLERATE,
+ g_variant_new_uint64((uint64_t)_samplerate));
+
+ srd_pd_output_callback_add(session, SRD_OUTPUT_ANN,
+ Decoder::annotation_callback, this);
+
+ // Create the decoder instance
+ srd_decoder_inst *const decoder_inst = srd_inst_new(
+ session, _decoder->id, _options);
+ if(!decoder_inst) {
+ _error_message = tr("Failed to initialise decoder");
+ return;
+ }