From 6cfc565a2cecd29c968c7eb3b8f8911021fe7b9c Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Tue, 22 May 2018 15:30:53 +0800 Subject: [PATCH] [buf_slot]: Fix slip of pen mpp_slots_get_unused_count should use buffer count rather than buf_size as the minuend. Change-Id: I975e186c826edfbadf6115cdf375826d03a5adc9 Signed-off-by: Herman Chen --- mpp/base/mpp_buf_slot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpp/base/mpp_buf_slot.cpp b/mpp/base/mpp_buf_slot.cpp index 813f122f..c5540ca1 100644 --- a/mpp/base/mpp_buf_slot.cpp +++ b/mpp/base/mpp_buf_slot.cpp @@ -993,7 +993,7 @@ RK_S32 mpp_slots_get_unused_count(MppBufSlots slots) MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots; AutoMutex auto_lock(impl->lock); slot_assert(impl, (impl->used_count >= 0) && (impl->used_count <= impl->buf_count)); - return impl->buf_size - impl->used_count; + return impl->buf_count - impl->used_count; } MPP_RET mpp_slots_set_prop(MppBufSlots slots, SlotsPropType type, void *val)