[vlc-devel] [PATCH] lib: lock the player before updating the viewpoint

Mark Lee mark.lee at capricasoftware.co.uk
Mon Apr 20 11:51:26 CEST 2020


---
 lib/video.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/video.c b/lib/video.c
index 6f8e6d7f59..4ab30e4d8b 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -274,8 +274,14 @@ int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
 
     enum vlc_player_whence whence = b_absolute ? VLC_PLAYER_WHENCE_ABSOLUTE
                                                : VLC_PLAYER_WHENCE_RELATIVE;
+
+    vlc_player_t *player = p_mi->player;
+    vlc_player_Lock(player);
+
     vlc_player_UpdateViewpoint(p_mi->player, &update, whence);
 
+    vlc_player_Unlock(player);
+
     /* may not fail anymore, keep int not to break the API */
     return 0;
 }
-- 
2.17.1



More information about the vlc-devel mailing list