<!DOCTYPE html><html><head><title></title><style type="text/css">
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>I propose to push this patch as it is<br></div><div><br>Maybe later we can improve parsing from many threads, but from what I saw in libvlc users, media is always parsed from the same thread.<br></div><div><br></div><div>On Tue, Oct 22, 2019, at 17:03, Thomas Guillem wrote:<br></div><blockquote type="cite" id="qt"><div><br></div><div>On Tue, Oct 22, 2019, at 13:28, Rémi Denis-Courmont wrote:<br></div><blockquote id="qt-qt" type="cite"><div>Hi,<br></div><div><br></div><div>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).<br></div></blockquote><div><br></div><div>If a second thread try to parse the media that is already parsing, it will return an error.<br></div><div>The media can be read from any threads, but only one thread can parse it now.<br></div><div><br></div><div>We could easily allow parsing from multiple threads by just returning success if already parsing. But we need to make sure that the second thread will receive the parse_ended event in all case.<br></div><div><br></div><blockquote id="qt-qt" type="cite"><div>This does not add up. I'm not sure which way is right, but it can't be both.<br></div><div><br></div><div class="qt-qt-gmail_quote"><div>Le 22 octobre 2019 13:45:14 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote class="qt-qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre class="qt-qt-k9mail"><div>Otherwise, events are not propagated after the first request.<br></div><div><br></div><div>cf. f37171e57b0d0af922215ffed19111a4f317fb29<hr> lib/media.c | 3 +++<br></div><div> 1 file changed, 3 insertions(+)<br></div><div><br></div><div>diff --git a/lib/media.c b/lib/media.c<br></div><div>index dd0513633f6..f0f1adb1bcf 100644<br></div><div>--- a/lib/media.c<br></div><div>+++ b/lib/media.c<br></div><div>@@ -781,7 +781,10 @@ static int media_parse(libvlc_media_t *media, bool b_async,<br></div><div>     needed = !media->has_asked_preparse;<br></div><div>     media->has_asked_preparse = true;<br></div><div>     if (needed)<br></div><div>+    {<br></div><div>         media->is_parsed = false;<br></div><div>+        media->parsed_status = 0;<br></div><div>+    }<br></div><div>     vlc_mutex_unlock(&media->parsed_lock);<br></div><div> <br></div><div>     if (needed)<br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div></body></html>