diff options
author | Aman Karmani <aman@tmm1.net> | 2021-11-24 23:10:47 -0800 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2022-04-02 21:41:58 +0300 |
commit | fb7b66ecf1b9fa2bd6f41d99a39412bcc5b84790 (patch) | |
tree | 24ca5e2a04e6091e4ed0336348ac6db8269c1ce5 /sub/osd_state.h | |
parent | 76b9254b8ba36101a0a99ca28a76ca93140807f5 (diff) | |
download | mpv-fb7b66ecf1b9fa2bd6f41d99a39412bcc5b84790.tar.bz2 mpv-fb7b66ecf1b9fa2bd6f41d99a39412bcc5b84790.tar.xz |
sub/osd: use atomic for osd_state.force_video_pts
this field is used only in a special vo draining edge case.
switching to an atomic reduces osd->lock contention
between the mpv core (in write_video) and vo threads
which are managing osd rendering manually (such as vo_rpi).
Signed-off-by: Aman Karmani <aman@tmm1.net>
Diffstat (limited to 'sub/osd_state.h')
-rw-r--r-- | sub/osd_state.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sub/osd_state.h b/sub/osd_state.h index 056e54b1a8..fc6e515610 100644 --- a/sub/osd_state.h +++ b/sub/osd_state.h @@ -3,6 +3,7 @@ #include <pthread.h> +#include "osdep/atomic.h" #include "osd.h" enum mp_osdtype { @@ -70,7 +71,7 @@ struct osd_state { struct osd_object *objs[MAX_OSD_PARTS]; bool render_subs_in_filter; - double force_video_pts; + mp_atomic_double force_video_pts; bool want_redraw; bool want_redraw_notification; |