Skip to content
  • Alexandre Janniaux's avatar
    lib: media: wait preparse end before release · 7f19eca5
    Alexandre Janniaux authored
    This is a quick fix for #25296 actually reverting the commit
    a708c988, replacing the Hold/Release
    lifecycle used there by an ad-hoc Hold/Release which actually defer the
    actual release by blocking instead of releasing in the preparser thread.
    
    Indeed, libvlc_media is holding the instance used to create it, though
    it only needs it for preparsing. If the last reference of the media is
    hold by the preparser, libvlc_media will be released by the preparser
    thread and the libvlc_instance potentially released from there too.
    Since killing the libvlc_instance will join the preparser thread, it
    cannot be done from the preparser thread, or would lead to the failure
    detailed in #25296. Written differently, only the final client should
    make use of Hold/Release, directly through the adequate function or
    indirectly through the creation of new objects.
    
    In addition, a708c988 cannot just be
    reverted as it was fixi...
    7f19eca5