+
+err:
+ PyGILState_Release(gstate);
+
+ return SRD_ERR;
+
+ret_9999:
+ PyGILState_Release(gstate);
+
+ return 9999;
+}
+
+/**
+ * Create a SKIP condition list for condition-less .wait() calls.
+ *
+ * @param di Decoder instance.
+ * @param count Number of samples to skip.
+ *
+ * @retval SRD_OK The new condition list was set successfully.
+ * @retval SRD_ERR There was an error setting the new condition list.
+ * The contents of di->condition_list are undefined.
+ *
+ * This routine is a reduced and specialized version of the @ref
+ * set_new_condition_list() and @ref create_term_list() routines which
+ * gets invoked when .wait() was called without specifications for
+ * conditions. This minor duplication of the SKIP term list creation
+ * simplifies the logic and avoids the creation of expensive Python
+ * objects with "constant" values which the caller did not pass in the
+ * first place. It results in maximum sharing of match handling code
+ * paths.
+ */
+static int set_skip_condition(struct srd_decoder_inst *di, uint64_t count)
+{
+ struct srd_term *term;
+ GSList *term_list;
+
+ condition_list_free(di);
+ term = g_malloc(sizeof(*term));
+ term->type = SRD_TERM_SKIP;
+ term->num_samples_to_skip = count;
+ term->num_samples_already_skipped = 0;
+ term_list = g_slist_append(NULL, term);
+ di->condition_list = g_slist_append(di->condition_list, term_list);
+
+ return SRD_OK;