mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
ringbuffer fix from upstream
This commit is contained in:
parent
09e8a15d78
commit
727fba48be
@ -391,7 +391,9 @@ ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t*
|
|||||||
idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
|
idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
consumed = (idx - rbuf->pread) % rbuf->size;
|
consumed = idx - rbuf->pread;
|
||||||
|
if (consumed < 0)
|
||||||
|
consumed += rbuf->size;
|
||||||
|
|
||||||
while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
|
while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user