- * srd_inst_decode(di, 0, 1023, inbuf, 1024, 1);
- * srd_inst_decode(di, 1024, 2047, inbuf, 1024, 1);
- * srd_inst_decode(di, 2048, 3071, inbuf, 1024, 1);
- * srd_inst_decode(di, 3072, 4095, inbuf, 1024, 1);
+ * srd_inst_decode(di, 0, 1024, inbuf, 1024, 1);
+ * srd_inst_decode(di, 1024, 2048, inbuf, 1024, 1);
+ * srd_inst_decode(di, 2048, 3072, inbuf, 1024, 1);
+ * srd_inst_decode(di, 3072, 4096, inbuf, 1024, 1);
- * srd_inst_decode(di, 0, 1023, inbuf, 1024, 1);
- * srd_inst_decode(di, 1024, 1123, inbuf, 100, 1);
- * srd_inst_decode(di, 1124, 1423, inbuf, 300, 1);
- * srd_inst_decode(di, 1424, 1642, inbuf, 219, 1);
- * srd_inst_decode(di, 1643, 2047, inbuf, 405, 1);
- * srd_inst_decode(di, 2048, 3071, inbuf, 1024, 1);
- * srd_inst_decode(di, 3072, 4095, inbuf, 1024, 1);
+ * srd_inst_decode(di, 0, 1024, inbuf, 1024, 1);
+ * srd_inst_decode(di, 1024, 1124, inbuf, 100, 1);
+ * srd_inst_decode(di, 1124, 1424, inbuf, 300, 1);
+ * srd_inst_decode(di, 1424, 1643, inbuf, 219, 1);
+ * srd_inst_decode(di, 1643, 2048, inbuf, 405, 1);
+ * srd_inst_decode(di, 2048, 3072, inbuf, 1024, 1);
+ * srd_inst_decode(di, 3072, 4096, inbuf, 1024, 1);
*
* INCORRECT example (4096 samples total, 4 chunks @ 1024 samples each, but
* the start- and end-samplenumbers are not absolute):
*
* INCORRECT example (4096 samples total, 4 chunks @ 1024 samples each, but
* the start- and end-samplenumbers are not absolute):
- * srd_inst_decode(di, 0, 1023, inbuf, 1024, 1);
- * srd_inst_decode(di, 0, 1023, inbuf, 1024, 1);
- * srd_inst_decode(di, 0, 1023, inbuf, 1024, 1);
- * srd_inst_decode(di, 0, 1023, inbuf, 1024, 1);
+ * srd_inst_decode(di, 0, 1024, inbuf, 1024, 1);
+ * srd_inst_decode(di, 0, 1024, inbuf, 1024, 1);
+ * srd_inst_decode(di, 0, 1024, inbuf, 1024, 1);
+ * srd_inst_decode(di, 0, 1024, inbuf, 1024, 1);
+ if (abs_start_samplenum != di->abs_cur_samplenum ||
+ abs_end_samplenum < abs_start_samplenum) {
+ srd_dbg("Incorrect sample numbers: start=%" PRIu64 ", cur=%"
+ PRIu64 ", end=%" PRIu64 ".", abs_start_samplenum,
+ di->abs_cur_samplenum, abs_end_samplenum);
+ return SRD_ERR_ARG;
+ }
+