+ Py_DecRef(di->py_inst);
+ g_free(di->inst_id);
+ g_free(di->dec_probemap);
+ g_slist_free(di->next_di);
+ for (l = di->pd_output; l; l = l->next) {
+ pdo = l->data;
+ g_free(pdo->proto_id);
+ g_free(pdo);
+ }
+ g_slist_free(di->pd_output);
+}
+
+SRD_PRIV void srd_inst_free_all(GSList *stack)
+{
+ GSList *l;
+ struct srd_decoder_inst *di;
+
+ di = NULL;
+ for (l = stack ? stack : di_list; di == NULL && l != NULL; l = l->next) {
+ di = l->data;
+ if (di->next_di)
+ srd_inst_free_all(di->next_di);
+ srd_inst_free(di);
+ }
+ if (!stack) {
+ g_slist_free(di_list);
+ di_list = NULL;
+ }
+}
+
+/**
+ * Start a decoding session.
+ *
+ * Decoders, instances and stack must have been prepared beforehand.
+ *
+ * @param num_probes The number of probes which the incoming feed will contain.
+ * @param unitsize The number of bytes per sample in the incoming feed.
+ * @param samplerate The samplerate of the incoming feed.
+ *
+ * @return SRD_OK upon success, a (negative) error code otherwise.
+ */
+SRD_API int srd_session_start(int num_probes, int unitsize, uint64_t samplerate)