X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=session.c;h=0c1ef8205634512f1d7de78a2e0d80f5ff2e271c;hp=128d2240301e8de52eb788a14cf8f4fffb35f8b7;hb=44789507022fe44660a6920bb7133d18839994a6;hpb=4564e8e53af85e696a58e43677bae87470c52771 diff --git a/session.c b/session.c index 128d224..0c1ef82 100644 --- a/session.c +++ b/session.c @@ -131,11 +131,14 @@ static int srd_inst_send_meta(struct srd_decoder_inst *di, int key, GSList *l; struct srd_decoder_inst *next_di; int ret; + PyGILState_STATE gstate; if (key != SRD_CONF_SAMPLERATE) /* This is the only key we pass on to the decoder for now. */ return SRD_OK; + gstate = PyGILState_Ensure(); + if (PyObject_HasAttrString(di->py_inst, "metadata")) { py_ret = PyObject_CallMethod(di->py_inst, "metadata", "lK", (long)SRD_CONF_SAMPLERATE, @@ -143,6 +146,8 @@ static int srd_inst_send_meta(struct srd_decoder_inst *di, int key, Py_XDECREF(py_ret); } + PyGILState_Release(gstate); + /* Push metadata to all the PDs stacked on top of this one. */ for (l = di->next_di; l; l = l->next) { next_di = l->data; @@ -199,7 +204,7 @@ SRD_API int srd_session_metadata_set(struct srd_session *sess, int key, return SRD_ERR_ARG; } - srd_dbg("Setting session %d samplerate to %"PRIu64".", + srd_dbg("Setting session %d samplerate to %"G_GUINT64_FORMAT".", sess->session_id, g_variant_get_uint64(data)); ret = SRD_OK;