[vlc-commits] [Git][videolan/vlc][master] 3 commits: medialibrary: add an option to disable network discovery

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 5 14:50:41 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f0064233 by paarth Dhammi at 2026-11-05T14:37:54+00:00
medialibrary: add an option to disable network discovery

- - - - -
e8bfbbbd by paarth Dhammi at 2026-11-05T14:37:54+00:00
macosx: Disable network discovery in library integration tests

- - - - -
b35060be by paarth Dhammi at 2026-11-05T14:37:54+00:00
macosx: Poll library model startup counts in tests

- - - - -


4 changed files:

- modules/gui/macosx/tests/VLCLibraryDataTypesIntegrationTestSupport.m
- modules/gui/macosx/tests/VLCLibraryModelIntegrationTest.m
- modules/gui/macosx/tests/VLCLibraryModelTestSupport.m
- modules/misc/medialibrary/medialibrary.cpp


Changes:

=====================================
modules/gui/macosx/tests/VLCLibraryDataTypesIntegrationTestSupport.m
=====================================
@@ -338,6 +338,7 @@ BOOL VLCLibraryDataTypesIntegrationStart(void)
         "--text-renderer=dummy",
         "--no-auto-preparse",
         "--media-library",
+        "--no-ml-network-discovery",
     };
     sIntfReady = dispatch_semaphore_create(0);
     sLibVLC = libvlc_new((int)(sizeof(args) / sizeof(args[0])), args);


=====================================
modules/gui/macosx/tests/VLCLibraryModelIntegrationTest.m
=====================================
@@ -1236,7 +1236,6 @@
     XCTestExpectation * const loaded = [self expectationForNotification:VLCLibraryModelListOfMonitoredFoldersUpdated
                                                                  object:self.model
                                                                 handler:nil];
-    [self.model resetCachedListOfMonitoredFolders];
     [self waitForExpectations:@[ loaded ] timeout:5.];
     XCTAssertGreaterThan(self.model.cachedListOfMonitoredFolders.count, (NSUInteger)0);
     NSArray<VLCMediaLibraryFolderObserver *> * const previousObservers = self.model.folderObservers;
@@ -1682,7 +1681,6 @@
     XCTestExpectation * const loaded = [self expectationForNotification:VLCLibraryModelListOfMonitoredFoldersUpdated
                                                                  object:self.model
                                                                 handler:nil];
-    [self.model resetCachedListOfMonitoredFolders];
     [self waitForExpectations:@[ loaded ] timeout:5.];
     __weak VLCMediaLibraryFolderObserver *previousObserver = nil;
     NSSet<NSURL *> *previousURLs = nil;


=====================================
modules/gui/macosx/tests/VLCLibraryModelTestSupport.m
=====================================
@@ -345,14 +345,9 @@ VLCMediaLibraryMediaItem *VLCLibraryModelTestMediaItem(vlc_ml_media_type_t type,
 
 - (void)waitForInitialCounts
 {
-    NSPredicate * const predicate = [NSPredicate predicateWithBlock:
-        ^BOOL(VLCLibraryModelTestQueryGate *model,
-              NSDictionary * __unused bindings) {
-        return model.initialCountsLoaded;
-    }];
-    XCTNSPredicateExpectation * const counts = [[XCTNSPredicateExpectation alloc] initWithPredicate:predicate
-                                                                                         object:self];
-    XCTAssertEqual([XCTWaiter waitForExpectations:@[ counts ] timeout:10.], XCTWaiterResultCompleted);
+    for (NSUInteger attempt = 0; attempt < 1000 && !self.initialCountsLoaded; attempt++)
+        [NSThread sleepForTimeInterval:.01];
+    XCTAssertTrue(self.initialCountsLoaded);
 }
 
 - (void)holdNextQueryResultForGetter:(SEL)getter


=====================================
modules/misc/medialibrary/medialibrary.cpp
=====================================
@@ -495,7 +495,8 @@ bool MediaLibrary::Init()
         return false;
     }
 
-    m_ml->setDiscoverNetworkEnabled( true );
+    m_ml->setDiscoverNetworkEnabled(
+        var_InheritBool( VLC_OBJECT( m_vlc_ml ), "ml-network-discovery" ) );
 
     m_initialized = true;
     return true;
@@ -2701,6 +2702,7 @@ static void Close( vlc_object_t* obj )
                               "media from" )
 
 #define ML_VERBOSE _( "Extra verbose media library logs" )
+#define ML_NETWORK_DISCOVERY N_( "Discover network shares" )
 
 vlc_module_begin()
     set_shortname(N_("media library"))
@@ -2709,4 +2711,5 @@ vlc_module_begin()
     set_capability("medialibrary", 100)
     set_callbacks(Open, Close)
     add_bool( "ml-verbose", false, ML_VERBOSE, nullptr )
+    add_bool( "ml-network-discovery", true, ML_NETWORK_DISCOVERY, nullptr )
 vlc_module_end()



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4ae97e2058968fea10be099ea7ee46050ef6c2f8...b35060be5eef3caa126e370a6817bc59bfc3e3c4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4ae97e2058968fea10be099ea7ee46050ef6c2f8...b35060be5eef3caa126e370a6817bc59bfc3e3c4
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