[PATCH] media: videobuf2: num_buffers should record the number of all buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The variable q->num_buffers records the number of buffers previously
applied for, and the variable allocated_buffers records the number of
buffers applied for this time, so the total number should be the sum
of these two buffers.

Signed-off-by: Dianlong Li <dianlong_lee@xxxxxxx>
---
 drivers/media/common/videobuf2/videobuf2-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index 4eab6d81cce1..2716c4138655 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -836,7 +836,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
 	}
 
 	mutex_lock(&q->mmap_lock);
-	q->num_buffers = allocated_buffers;
+	q->num_buffers += allocated_buffers;
 
 	if (ret < 0) {
 		/*
-- 
2.25.1





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux