[vlc-commits] [Git][videolan/vlc][master] 2 commits: medialibrary: always release thumbnail requests

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Dec 5 15:12:26 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5d908db8 by Alaric Senat at 2023-12-05T14:52:57+00:00
medialibrary: always release thumbnail requests

Thumbnail requests must always be released since ca3b131594764f5658094ab7db876fa0274d13c1.

A failing thumbnail also need to have its request destroyed.
Moving the release call before the null thumbnail condition allow for a
systematic release of the request. Removing the release call from the
`stop()` method is also necessary now, as it would otherwise cause a double
free. The condition variable triggering the request deletion is signaled in
`stop()`.

- - - - -
45c94e81 by Alaric Senat at 2023-12-05T14:52:57+00:00
medialibrary: thumb: remove unnecessary NULL assignation

- - - - -


1 changed file:

- modules/misc/medialibrary/Thumbnailer.cpp


Changes:

=====================================
modules/misc/medialibrary/Thumbnailer.cpp
=====================================
@@ -81,11 +81,11 @@ bool Thumbnailer::generate( const medialibrary::IMedia&, const std::string& mrl,
             m_cond.wait( m_mutex );
         m_currentContext = nullptr;
     }
-    if ( ctx.thumbnail == nullptr )
-        return false;
 
     vlc_thumbnailer_DestroyRequest(m_thumbnailer.get(), ctx.request);
-    ctx.request = NULL;
+
+    if ( ctx.thumbnail == nullptr )
+        return false;
 
     block_t* block;
     if ( picture_Export( VLC_OBJECT( m_ml ), &block, nullptr, ctx.thumbnail,
@@ -106,8 +106,6 @@ void Thumbnailer::stop()
     vlc::threads::mutex_locker lock{ m_mutex };
     if ( m_currentContext != nullptr )
     {
-        vlc_thumbnailer_DestroyRequest( m_thumbnailer.get(),
-                                        m_currentContext->request );
         m_currentContext->done = true;
         m_cond.signal();
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/396ab4f67cbec90f07fcc781276c7bd632ca104b...45c94e816731034117830a7e77784a49a1df1f66

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/396ab4f67cbec90f07fcc781276c7bd632ca104b...45c94e816731034117830a7e77784a49a1df1f66
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list