Commit 82120ce2 authored by Rafaël Carré's avatar Rafaël Carré

osx: fix crash with --no-media-library

parent 778091a7
...@@ -914,7 +914,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -914,7 +914,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (NSInteger)sourceList:(PXSourceList*)aSourceList badgeValueForItem:(id)item - (NSInteger)sourceList:(PXSourceList*)aSourceList badgeValueForItem:(id)item
{ {
playlist_t * p_playlist = pl_Get(VLCIntf); playlist_t * p_playlist = pl_Get(VLCIntf);
NSInteger i_playlist_size; NSInteger i_playlist_size = 0;
if ([[item identifier] isEqualToString: @"playlist"]) { if ([[item identifier] isEqualToString: @"playlist"]) {
PL_LOCK; PL_LOCK;
...@@ -925,6 +925,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -925,6 +925,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
} }
if ([[item identifier] isEqualToString: @"medialibrary"]) { if ([[item identifier] isEqualToString: @"medialibrary"]) {
PL_LOCK; PL_LOCK;
if (p_playlist->p_ml_category)
i_playlist_size = p_playlist->p_ml_category->i_children; i_playlist_size = p_playlist->p_ml_category->i_children;
PL_UNLOCK; PL_UNLOCK;
...@@ -1014,6 +1015,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1014,6 +1015,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if ([[item identifier] isEqualToString:@"playlist"]) { if ([[item identifier] isEqualToString:@"playlist"]) {
[[[VLCMain sharedInstance] playlist] setPlaylistRoot:p_playlist->p_local_category]; [[[VLCMain sharedInstance] playlist] setPlaylistRoot:p_playlist->p_local_category];
} else if ([[item identifier] isEqualToString:@"medialibrary"]) { } else if ([[item identifier] isEqualToString:@"medialibrary"]) {
if (p_playlist->p_ml_category)
[[[VLCMain sharedInstance] playlist] setPlaylistRoot:p_playlist->p_ml_category]; [[[VLCMain sharedInstance] playlist] setPlaylistRoot:p_playlist->p_ml_category];
} else { } else {
playlist_item_t * pl_item; playlist_item_t * pl_item;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment