di->got_new_samples = FALSE;
di->handled_all_samples = FALSE;
di->want_wait_terminate = FALSE;
+ di->decoder_state = SRD_OK;
/*
* Strictly speaking initialization of statically allocated
di->got_new_samples = FALSE;
di->handled_all_samples = FALSE;
di->want_wait_terminate = FALSE;
+ di->decoder_state = SRD_OK;
/* Conditions and mutex got reset after joining the thread. */
}
py_res = PyObject_CallMethod(di->py_inst, "decode", NULL);
srd_dbg("%s: decode() method terminated.", di->inst_id);
+ if (!py_res)
+ di->decoder_state = SRD_ERR;
+
/*
* Make sure to unblock potentially pending srd_inst_decode()
* calls in application threads after the decode() method might
return ret;
}
- return SRD_OK;
+ return di->decoder_state;
}
/** @private */
/** Requests termination of wait() and decode(). */
gboolean want_wait_terminate;
+ /** Indicates the current state of the decoder stack. */
+ int decoder_state;
+
GCond got_new_samples_cond;
GCond handled_all_samples_cond;
GMutex data_mutex;