Be strict about reflinks
This commit is contained in:
parent
6218cd3020
commit
1e44e71503
@ -30,10 +30,12 @@ bool buffer_consumed(buffer_t *buf, const char *who)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_lock(&buffer_lock);
|
pthread_mutex_lock(&buffer_lock);
|
||||||
if (buf->mmap_reflinks > 0) {
|
if (buf->mmap_reflinks == 0) {
|
||||||
buf->mmap_reflinks--;
|
E_LOG_PERROR(buf, "Non symmetric reference counts");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buf->mmap_reflinks--;
|
||||||
|
|
||||||
if (!buf->enqueued && buf->mmap_reflinks == 0) {
|
if (!buf->enqueued && buf->mmap_reflinks == 0) {
|
||||||
// update used bytes
|
// update used bytes
|
||||||
if (buf->buf_list->do_mplanes) {
|
if (buf->buf_list->do_mplanes) {
|
||||||
@ -171,6 +173,10 @@ buffer_t *buffer_list_dequeue(buffer_list_t *buf_list)
|
|||||||
}
|
}
|
||||||
buf->v4l2_buffer.flags = v4l2_buf.flags;
|
buf->v4l2_buffer.flags = v4l2_buf.flags;
|
||||||
|
|
||||||
|
if (buf->mmap_reflinks > 0) {
|
||||||
|
E_LOG_PERROR(buf, "Buffer appears to be enqueued? (links=%d)", buf->mmap_reflinks);
|
||||||
|
}
|
||||||
|
|
||||||
buf->enqueued = false;
|
buf->enqueued = false;
|
||||||
buf->mmap_reflinks = 1;
|
buf->mmap_reflinks = 1;
|
||||||
uint64_t enqueued_time_us = get_monotonic_time_us(NULL, NULL) - buf->enqueued_time_us;
|
uint64_t enqueued_time_us = get_monotonic_time_us(NULL, NULL) - buf->enqueued_time_us;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user