[vlc-devel] [PATCH 6/6] medialib: fs: device: Fix device removal

Hugo Beauzée-Luyssen hugo at beauzee.fr
Fri Aug 21 08:15:13 CEST 2020


It was lacking the same terminal '/' appending we do when a device gets
added, causing a mismatch depending on the SD module triggering the
removal
---
 modules/misc/medialibrary/fs/device.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/misc/medialibrary/fs/device.cpp b/modules/misc/medialibrary/fs/device.cpp
index 87227d4b5b..b1baa25389 100644
--- a/modules/misc/medialibrary/fs/device.cpp
+++ b/modules/misc/medialibrary/fs/device.cpp
@@ -92,8 +92,13 @@ void SDDevice::addMountpoint( std::string mrl )
     }
 }
 
-void SDDevice::removeMountpoint( const std::string& mrl )
+void SDDevice::removeMountpoint( const std::string& cmrl )
 {
+    std::string mrl;
+    if ( *cmrl.crbegin() != '/' )
+        mrl = cmrl + '/';
+    else
+        mrl = cmrl;
     auto it = std::find_if( begin( m_mountpoints ), end( m_mountpoints ),
                             [&mrl]( const Mountpoint& mp ) { return mp.mrl == mrl; } );
     if ( it != end( m_mountpoints ) )
-- 
2.20.1



More information about the vlc-devel mailing list