summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorxylosper <darklin20@gmail.com>2015-01-09 04:16:49 +0900
committerwm4 <wm4@nowhere>2015-01-08 21:15:09 +0100
commit5bb3b1b4cf758d1af42bc1b8fc8588b52bbb6770 (patch)
tree72ec7027721a6c54940e8775285eb37c4bfb70f1 /video/out
parent5b4d587ede93d1e215f9dcb1bb24afc92492e676 (diff)
downloadmpv-5bb3b1b4cf758d1af42bc1b8fc8588b52bbb6770.tar.bz2
mpv-5bb3b1b4cf758d1af42bc1b8fc8588b52bbb6770.tar.xz
vo: add functions to increment drop_count
Add two functions which increment drop_count thread-safely. This is for the commit followed.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo.c7
-rw-r--r--video/out/vo.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index b7b017138d..2a0f17c748 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -730,6 +730,13 @@ int64_t vo_get_drop_count(struct vo *vo)
return r;
}
+void vo_increment_drop_count(struct vo *vo, int64_t n)
+{
+ pthread_mutex_lock(&vo->in->lock);
+ vo->in->drop_count += n;
+ pthread_mutex_unlock(&vo->in->lock);
+}
+
// Make the VO redraw the OSD at some point in the future.
void vo_redraw(struct vo *vo)
{
diff --git a/video/out/vo.h b/video/out/vo.h
index ab7d97ae49..20223493cd 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -319,6 +319,7 @@ void vo_seek_reset(struct vo *vo);
void vo_destroy(struct vo *vo);
void vo_set_paused(struct vo *vo, bool paused);
int64_t vo_get_drop_count(struct vo *vo);
+void vo_increment_drop_count(struct vo *vo, int64_t n);
void vo_query_formats(struct vo *vo, uint8_t *list);
void vo_event(struct vo *vo, int event);
int vo_query_and_reset_events(struct vo *vo, int events);