[vlc-commits] macosx: fix crash when displaying the Media Information panel with disabled local stats

Felix Paul Kühne git at videolan.org
Wed Nov 14 12:31:07 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Nov 14 12:28:33 2012 +0100| [c1fa23c0075c3ab928c80211029211bedbc03300] | committer: Felix Paul Kühne

macosx: fix crash when displaying the Media Information panel with disabled local stats
(cherry picked from commit a44da88b77a1fe47f5e49c11106261d8b50315f8)

Conflicts:
	modules/gui/macosx/playlistinfo.m

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

 modules/gui/macosx/playlistinfo.h |    1 +
 modules/gui/macosx/playlistinfo.m |   10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/playlistinfo.h b/modules/gui/macosx/playlistinfo.h
index 7c5a4cd..bdb2ba9 100644
--- a/modules/gui/macosx/playlistinfo.h
+++ b/modules/gui/macosx/playlistinfo.h
@@ -100,6 +100,7 @@
     input_item_t * p_item;
 
     BOOL b_awakeFromNib;
+    BOOL b_stats;
 }
 
 - (void)initPanel;
diff --git a/modules/gui/macosx/playlistinfo.m b/modules/gui/macosx/playlistinfo.m
index be2a201..08c5955 100644
--- a/modules/gui/macosx/playlistinfo.m
+++ b/modules/gui/macosx/playlistinfo.m
@@ -140,14 +140,14 @@ static VLCInfo *_o_sharedInstance = nil;
 
 - (void)initPanel
 {
-    BOOL b_stats = config_GetInt(VLCIntf, "stats");
-    if( !b_stats )
-    {
+    b_stats = config_GetInt(VLCIntf, "stats");
+    if( !b_stats ) {
         if( [o_tab_view numberOfTabViewItems] > 2 )
             [o_tab_view removeTabViewItem: [o_tab_view tabViewItemAtIndex: 2]];
     }
+    else
+        [self initMediaPanelStats];
 
-    [self initMediaPanelStats];
     [o_info_window makeKeyAndOrderFront: self];
 }
 
@@ -280,7 +280,7 @@ static VLCInfo *_o_sharedInstance = nil;
 
 - (void)updateStatistics
 {
-    if (!b_awakeFromNib)
+    if (!b_awakeFromNib || !b_stats)
         return;
 
     if ([o_info_window isVisible])



More information about the vlc-commits mailing list