[vlc-devel] [PATCH] Revert "macosx: fixed compilation warning and potential, runtime exception"

Josh Watzman jwatzman at jwatzman.org
Wed Oct 16 08:21:40 CEST 2013


This reverts commit 55e3f94302a29e9ee76532c290c1134af5f0213e and fixes it the right way. I'm honestly not sure what's going on in that commit -- it silences the compiler warning not by actually fixing the problem (which is that the method isn't declared in the interface) but just by not making the method call visible to the compiler! It also completely breaks the feature, by moving things onto the main thread that can't be there, causing a deadlock, as specifically noted in the comment right above this code.

In any event, it's easy enough to revert and add to the interface properly, silencing the compiler warning and unbreaking this extension feature.
---
 modules/gui/macosx/intf.h | 1 +
 modules/gui/macosx/intf.m | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index e26f654..fdb2ff1 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -183,6 +183,7 @@ struct intf_sys_t
 - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
 
 - (void)PlaylistItemChanged;
+- (void)informInputChanged;
 - (void)playbackStatusUpdated;
 - (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
 - (void)playbackModeUpdated;
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index aa1378d..a213502 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -430,8 +430,8 @@ static int PLItemChanged(vlc_object_t *p_this, const char *psz_var,
      * and other issues, we need to wait for -PlaylistItemChanged to finish and
      * then -informInputChanged on this non-main thread. */
     [o_plItemChangedLock lock];
-    [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(PlaylistItemChanged) withObject:nil waitUntilDone:YES];
-    [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(informInputChanged) withObject:nil waitUntilDone:YES];
+    [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(PlaylistItemChanged) withObject:nil waitUntilDone:YES]; // MUST BE ON MAIN THREAD
+    [[VLCMain sharedInstance] informInputChanged]; // DO NOT MOVE TO MAIN THREAD
     [o_plItemChangedLock unlock];
 
     [o_pool release];
-- 
1.8.4



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131015/40895402/attachment.sig>


More information about the vlc-devel mailing list