[vlc-devel] [PATCH 1/2] libvlc: deactivate the playlist before destroying the preparser

Filip Roséen filip at atch.se
Thu Aug 25 15:33:03 CEST 2016

Hi again,

On 16/08/25 16:19, Rémi Denis-Courmont wrote:

> That´s what I don´t understand. How is deactivating the playlist,
> i.e. shutting down the playlist thread, making a difference here?

If the playlist is not deactivated prior to destroying the preparser,
the playlist can indirectly cause the preparser to be invoked again at
a time where the preparser is either about the be shut down, or has
already been deleted.

> I don´t actually think that there is anything wrong with the
> preparser in the first place. The playlist fails to deregister its
> callbacks; the root cause of the bug lies in the playlist, not the
> preparser.
There are plenty of bugs in the current preparser implementation,
among other things:

  - the timeout mechanism is broken,
  - requests for preparsing is blocking at times where it should not,
  - there is really no reason for the preparser thread to be in
    *DETACH* state,
  - there are races due to weird locking mechanisms.

I plan on creating tickets for my findings as soon as possible (prior
to me submitting new implemenations in order to fix them).


The Preparser + Playlist

In terms of talking about the preparser and its relationship with the
playlist it is broken because the playlist does not own the preparser,
and the preparser does not own the playlist.

The above leads to a *chicken-and-egg* problem, and circumventing it
is the purpose of the step we are discussing. Though as already stated
I hope to solve it in a different manner all together (which includes
a new preparsing implementation).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160825/cedcfba7/attachment.html>

More information about the vlc-devel mailing list