[vlc-commits] macosx: Remove VoutWindowController lock
Marvin Scholz
git at videolan.org
Sun Sep 3 14:28:09 CEST 2017
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Aug 9 00:23:17 2017 +0200| [167a48e47a2783affdc77ec3c90c17e8bc01befb] | committer: David Fuhrmann
macosx: Remove VoutWindowController lock
The lock does not protect anything meaningful anymore and seems
useless.
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=167a48e47a2783affdc77ec3c90c17e8bc01befb
---
modules/gui/macosx/VLCMain.m | 2 --
modules/gui/macosx/VLCVoutWindowController.h | 2 --
modules/gui/macosx/VLCVoutWindowController.m | 8 --------
3 files changed, 12 deletions(-)
diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
index 1f355a268e..ce1591a53d 100644
--- a/modules/gui/macosx/VLCMain.m
+++ b/modules/gui/macosx/VLCMain.m
@@ -350,10 +350,8 @@ static VLCMain *sharedInstance = nil;
[[NSNotificationCenter defaultCenter] removeObserver: self];
- [_voutController.lock lock];
// closes all open vouts
_voutController = nil;
- [_voutController.lock unlock];
/* write cached user defaults to disk */
[[NSUserDefaults standardUserDefaults] synchronize];
diff --git a/modules/gui/macosx/VLCVoutWindowController.h b/modules/gui/macosx/VLCVoutWindowController.h
index cd0fdd9469..8959e2860b 100644
--- a/modules/gui/macosx/VLCVoutWindowController.h
+++ b/modules/gui/macosx/VLCVoutWindowController.h
@@ -33,8 +33,6 @@
@interface VLCVoutWindowController : NSObject
- at property (readonly, atomic) NSLock *lock;
-
@property (readonly, nonatomic) NSInteger currentStatusWindowLevel;
- (VLCVoutView *)setupVoutForWindow:(vout_window_t *)p_wnd withProposedVideoViewPosition:(NSRect)videoViewPosition;
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index 32fced7b89..9b086c8f60 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -63,7 +63,6 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
if (!voutController) {
return VLC_EGENERIC;
}
- [voutController.lock lock];
__block VLCVoutView *videoView = nil;
@@ -78,8 +77,6 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
msg_Dbg(getIntf(), "returning videoview with proposed position x=%i, y=%i, width=%i, height=%i", cfg->x, cfg->y, cfg->width, cfg->height);
p_wnd->handle.nsobject = (void *)CFBridgingRetain(videoView);
- [voutController.lock unlock];
-
p_wnd->type = VOUT_WINDOW_TYPE_NSOBJECT;
p_wnd->control = WindowControl;
}
@@ -94,7 +91,6 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
if (!voutController) {
return VLC_EGENERIC;
}
- [voutController.lock lock];
switch(i_query) {
case VOUT_WINDOW_SET_STATE:
@@ -150,13 +146,11 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
default:
{
msg_Warn(p_wnd, "unsupported control query: %i", i_query );
- [voutController.lock unlock];
return VLC_EGENERIC;
}
}
out:
- [voutController.lock unlock];
return VLC_SUCCESS;
}
}
@@ -169,11 +163,9 @@ void WindowClose(vout_window_t *p_wnd)
return;
}
- [voutController.lock lock];
dispatch_async(dispatch_get_main_queue(), ^{
[voutController removeVoutForDisplay:[NSValue valueWithPointer:p_wnd]];
});
- [voutController.lock unlock];
}
}
More information about the vlc-commits
mailing list