Skip to content

Assertion failure when fetching a media before the discoverer is started

Assertion failed: (isStarted() == true), function createDeviceFromMrl, file /Users/videolan/builds/F52MDqw7/0/videolan/vlc/extras/package/macosx/../../../modules/misc/medialibrary/fs/fs.cpp, line 83.

Thread 2 Crashed:
0   libsystem_kernel.dylib        	0x00007fff68228842 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff682ee671 pthread_kill + 263
2   libsystem_c.dylib             	0x00007fff6819b7c0 abort + 120
3   libsystem_c.dylib             	0x00007fff6819aa76 __assert_rtn + 314
4   libmedialibrary_plugin.dylib  	0x0000000109496504 vlc::medialibrary::SDFileSystemFactory::createDeviceFromMrl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 148
5   libmedialibrary_plugin.dylib  	0x00000001094d59e1 medialibrary::File::fromMrl(medialibrary::MediaLibrary const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 177
6   libmedialibrary_plugin.dylib  	0x000000010952d138 medialibrary::MediaLibrary::media(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 376
7   libmedialibrary_plugin.dylib  	0x00000001094629ea MediaLibrary::Get(int, __va_list_tag*) + 2266
8   libmedialibrary_plugin.dylib  	0x000000010946836f Get(vlc_medialibrary_module_t*, int, __va_list_tag*) + 47
9   libvlccore.9.dylib            	0x00000001072f31d5 vlc_ml_get + 437
10  libvlccore.9.dylib            	0x000000010728b7a4 vlc_ml_get_media_by_mrl + 36
11  libvlccore.9.dylib            	0x000000010728b26e vlc_player_input_RestoreMlStates + 174
12  libvlccore.9.dylib            	0x000000010727f2c2 vlc_player_input_New + 1106
13  libvlccore.9.dylib            	0x000000010727703f vlc_player_OpenNextMedia + 543
14  libvlccore.9.dylib            	0x000000010727e543 vlc_player_input_HandleState + 835
15  libvlccore.9.dylib            	0x000000010727dd18 vlc_player_destructor_Thread + 904
16  libsystem_pthread.dylib       	0x00007fff682ee9b4 _pthread_start + 224
17  libsystem_pthread.dylib       	0x00007fff682ea4d7 thread_start + 15

This is easy to fix, but if we want to be able to fetch a removable media early on, we either need to start the services discovery and wait for the device to come back (or not, so we'd hang for 5s which is not OK) or we need to cache the previous mountpoints and use those when no device information is available.

For this it's ok to yield a false positive if the media is actually missing since this is bound to a playback. If the media is indeed missing, the playback will fail and that's all we care about.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information