[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 <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2018-05-22 15:30:53 +08:00
parent 7ebc57b568
commit 6cfc565a2c

View File

@@ -993,7 +993,7 @@ RK_S32 mpp_slots_get_unused_count(MppBufSlots slots)
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots; MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
AutoMutex auto_lock(impl->lock); AutoMutex auto_lock(impl->lock);
slot_assert(impl, (impl->used_count >= 0) && (impl->used_count <= impl->buf_count)); 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) MPP_RET mpp_slots_set_prop(MppBufSlots slots, SlotsPropType type, void *val)