[vlc-commits] [Git][videolan/vlc][master] 3 commits: macosx: fix crash when revisiting Browse sidebar locations
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Fri Nov 6 06:26:44 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
9fbc0254 by Serhii Bykov at 2026-11-06T07:04:00+01:00
macosx: fix crash when revisiting Browse sidebar locations
- - - - -
7be47af4 by Serhii Bykov at 2026-11-06T07:04:00+01:00
macosx: avoid reloading the current Browse location
- - - - -
49b37e6a by Serhii Bykov at 2026-11-06T07:04:00+01:00
macosx: specify media source data source protocols
- - - - -
4 changed files:
- modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarViewController.m
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
- modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
- modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m
Changes:
=====================================
modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarViewController.m
=====================================
@@ -426,7 +426,6 @@ static NSString * const VLCLibrarySegmentCellIdentifier = @"VLCLibrarySegmentCel
} else if ([representedObject isKindOfClass:VLCLibrarySegmentBookmarkedLocation.class]) {
VLCLibrarySegmentBookmarkedLocation * const bookmarkedLocation =
(VLCLibrarySegmentBookmarkedLocation *)representedObject;
- self.libraryWindow.librarySegmentType = bookmarkedLocation.segmentType;
[self.libraryWindow browseFolderByMrl:bookmarkedLocation.mrl];
} else if ([representedObject isKindOfClass:VLCMediaLibraryGroup.class]) {
[self.libraryWindow presentLibraryItem:(VLCMediaLibraryGroup *)representedObject];
=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
=====================================
@@ -322,7 +322,6 @@
- (void)browseFolderByMrl:(NSString *)mrl
{
- [self presentBrowseView];
[self.baseDataSource browseFolderByMrl:mrl];
}
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
=====================================
@@ -867,6 +867,13 @@ referenceSizeForHeaderInSection:(NSInteger)section
- (void)reloadData
{
[self updateTableViewItems];
+ id<NSTableViewDataSource, NSCollectionViewDataSource> const currentDataSource =
+ self.childDataSource ?: self;
+ if (self.tableView.dataSource != currentDataSource ||
+ self.collectionView.dataSource != currentDataSource) {
+ return;
+ }
+
if (self.viewMode == VLCLibraryGridViewModeSegment) {
[self.collectionView reloadData];
} else if (self.childDataSource != nil) {
@@ -884,6 +891,10 @@ referenceSizeForHeaderInSection:(NSInteger)section
- (void)browseFolderByMrl:(NSString *)mrl
{
+ if ([self.childDataSource.nodeToDisplay.inputItem.MRL isEqualToString:mrl]) {
+ return;
+ }
+
vlc_preparser_t *p_preparser = getNetworkPreparser();
NSURL * const folderURL = [NSURL URLWithString:mrl];
VLCMediaSource * const mediaSource = folderURL.isFileURL
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m
=====================================
@@ -163,7 +163,8 @@ static NSValue * _Nullable inputItemIdentifier(VLCInputItem * _Nullable const in
[self.nodeToDisplay clearChildrenCache];
}
- if (self.parentBaseDataSource.childDataSource != self) {
+ if (self.parentBaseDataSource.childDataSource != self ||
+ self.tableView.dataSource != self) {
return;
}
@@ -265,7 +266,8 @@ static NSValue * _Nullable inputItemIdentifier(VLCInputItem * _Nullable const in
self.nodeObservation = [self.displayedMediaSource observeInputNode:nodeToDisplay
onChange:^(VLCMediaSourceNodeChange change) {
const typeof(self) strongSelf = weakSelf;
- if (strongSelf == nil || strongSelf.parentBaseDataSource.childDataSource != strongSelf) {
+ if (strongSelf == nil || strongSelf.parentBaseDataSource.childDataSource != strongSelf ||
+ strongSelf.tableView.dataSource != strongSelf) {
return;
}
switch (change) {
@@ -634,6 +636,11 @@ static NSValue * _Nullable inputItemIdentifier(VLCInputItem * _Nullable const in
- (void)reloadData
{
+ if (self.parentBaseDataSource.childDataSource != self ||
+ self.tableView.dataSource != self ||
+ self.collectionView.dataSource != self) {
+ return;
+ }
NSParameterAssert(self.tableView.dataSource == self);
if (!_collectionView.hidden) {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3008aa34f507dc51dadd5800b7099e00c9826131...49b37e6ac365045db0f5c967f769dac7678a906c
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3008aa34f507dc51dadd5800b7099e00c9826131...49b37e6ac365045db0f5c967f769dac7678a906c
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list