[vlc-commits] macosx/player: add missing locking

Felix Paul Kühne git at videolan.org
Mon Apr 29 19:27:03 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sat Apr 27 23:27:37 2019 +0200| [30401017d281ec102777d3d008eba6e20801386a] | committer: Felix Paul Kühne

macosx/player: add missing locking

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=30401017d281ec102777d3d008eba6e20801386a
---

 modules/gui/macosx/playlist/VLCPlayerController.m | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m b/modules/gui/macosx/playlist/VLCPlayerController.m
index d6526f25d1..01b997faed 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -1498,6 +1498,8 @@ static const struct vlc_player_aout_cbs player_aout_callbacks = {
 - (int)setABLoop
 {
     int ret = 0;
+
+    vlc_player_Lock(_p_player);
     switch (_abLoopState) {
         case VLC_PLAYER_ABLOOP_A:
             ret = vlc_player_SetAtoBLoop(_p_player, VLC_PLAYER_ABLOOP_B);
@@ -1511,13 +1513,17 @@ static const struct vlc_player_aout_cbs player_aout_callbacks = {
             ret = vlc_player_SetAtoBLoop(_p_player, VLC_PLAYER_ABLOOP_A);
             break;
     }
+    vlc_player_Unlock(_p_player);
 
     return ret;
 }
 
 - (int)disableABLoop
 {
-    return vlc_player_SetAtoBLoop(_p_player, VLC_PLAYER_ABLOOP_NONE);
+    vlc_player_Lock(_p_player);
+    int ret = vlc_player_SetAtoBLoop(_p_player, VLC_PLAYER_ABLOOP_NONE);
+    vlc_player_Unlock(_p_player);
+    return ret;
 }
 
 - (void)setEnableRecording:(BOOL)enableRecording



More information about the vlc-commits mailing list