[vlc-devel] [PATCH] lib: media: reset parsed_status on new parse request

Thomas Guillem thomas at gllm.fr
Thu Oct 24 11:01:21 CEST 2019

On Wed, Oct 23, 2019, at 19:11, Remi Denis-Courmont wrote:
> Le 2019-10-22 18:03, Thomas Guillem a écrit :
> > On Tue, Oct 22, 2019, at 13:28, Rémi Denis-Courmont wrote:
> > 
> >> Hi,
> >> 
> >> Just a few days ago, Hugo made the case that media can be used in
> >> multiple threads. Now, this seems to be doing the exact opposite,
> >> propose a design that won't work if multiple threads use the same
> >> media (and try to parse it).
> > 
> > If a second thread try to parse the media that is already parsing, it
> > will return an error.
> > 
> > The media can be read from any threads, but only one thread can parse
> > it now.
> That makes no sense to me.
> Either object can be *meaningfully* used in multiple threads or it 
> can't. Reading something that can change asynchronously is not 
> meaningful. Either this patch is wrong, or the other one is.

The bug I'm trying to solve happen in single thread context.
 - 1/ parse a media from the mainloop
 - 2/ wait, receive a failing notification (from a VLC thread but the event is propagated to the mainloop)
 - 3/ try again later from the mainloop.

3/ can't work if parsed_status is not reset.

After checking libvlc_media usage, it seems that it's always used single threaded (or locked with own user mutex).

I saw with Hugo about the refcount patch, he agreed to revert it.

I will wait the for revert then push this patch if you agree.
> -- 
> Rémi Denis-Courmont
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list