diff options
author | Andrew de Quincy <devnull@localhost> | 2004-04-14 10:31:21 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-04-14 10:31:21 +0000 |
commit | 79ceaf974e118af2de53c32ab64486df6b603c79 (patch) | |
tree | 4c9951a1616a91763e4ea5dd262a5d2548f20b9f /linux | |
parent | 5d5774fbc949110a27fd9c0cc26bde524bff4deb (diff) | |
download | mediapointer-dvb-s2-79ceaf974e118af2de53c32ab64486df6b603c79.tar.gz mediapointer-dvb-s2-79ceaf974e118af2de53c32ab64486df6b603c79.tar.bz2 |
Fixed dvb_ringbuffer_pkt_next not advancing to next packet
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c index 1ab5166fc..d761c3fe3 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c @@ -236,7 +236,14 @@ ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* int curpktlen; int curpktstatus; - if (idx == -1) idx = rbuf->pread; + if (idx == -1) { + idx = rbuf->pread; + } else { + curpktlen = rbuf->data[idx] << 8; + curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; + idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; + } + consumed = (idx - rbuf->pread) % rbuf->size; while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) { |