summaryrefslogtreecommitdiffstats
path: root/video/decode/lavc_dr1.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/decode/lavc_dr1.c')
-rw-r--r--video/decode/lavc_dr1.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/decode/lavc_dr1.c b/video/decode/lavc_dr1.c
index 03e2b5b873..f730a6c231 100644
--- a/video/decode/lavc_dr1.c
+++ b/video/decode/lavc_dr1.c
@@ -204,6 +204,16 @@ void mp_buffer_ref(struct FrameBuffer *buf)
pool_unlock();
}
+bool mp_buffer_check(struct FrameBuffer *buf)
+{
+ pool_lock();
+ bool ok = buf->refcount > 0;
+ if (ok)
+ buf->refcount++;
+ pool_unlock();
+ return ok;
+}
+
void mp_buffer_unref(struct FrameBuffer *buf)
{
FramePool *pool = buf->pool;