X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=type_decoder.c;h=cf7ec8e7c383b40b502201e4034b4b9b98e0a8de;hb=27a86cefb655ecdfb8d912a5388fe8768b264ff5;hp=6c6eab6b22f584cbcbb0324431cd53e7a0e988fd;hpb=819e508972da02a0dcff7f81178f0283546a9afd;p=libsigrokdecode.git diff --git a/type_decoder.c b/type_decoder.c index 6c6eab6..cf7ec8e 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -1098,6 +1098,11 @@ static PyObject *Decoder_wait(PyObject *self, PyObject *args) * when the sample data is exhausted. */ if (di->communicate_eof) { + /* Advance self.samplenum to the (absolute) last sample number. */ + py_samplenum = PyLong_FromUnsignedLongLong(di->abs_cur_samplenum); + PyObject_SetAttrString(di->py_inst, "samplenum", py_samplenum); + Py_DECREF(py_samplenum); + /* Raise an EOFError Python exception. */ srd_dbg("%s: %s: Raising EOF from wait().", di->inst_id, __func__); g_mutex_unlock(&di->data_mutex);