<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div>On Mon, Nov 18, 2019, at 16:56, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt"><div>I don't see how the error message is wrong. It is not permissible to read from a paused stream, by definition. This patch looks wrong to me.<br></div></blockquote><div><br></div><div>Some demuxers are reading while paused, here are the reproduce steps:<br></div><div><br></div><div> - Open a distant MKV (http/smb/...)<br></div><div> - Pause via the UI<br></div><div> - Seek<br></div><div><br></div><div>So, maybe it's only the MKV that read() from demux seeks controls.<br></div><div><br></div><div>I didn't find any documentation that forbid that behavior. What should we do then ?<br></div><div><br></div><blockquote type="cite" id="qt"><div><br></div><div class="qt-gmail_quote"><div>Le 18 novembre 2019 16:00:49 GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote 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;" class="qt-gmail_quote"><pre class="qt-k9mail"><div>This commit remove the wrong error message and put back the thread to sleep at<br></div><div>the end of the read.<hr> modules/stream_filter/prefetch.c | 5 ++++-<br></div><div> 1 file changed, 4 insertions(+), 1 deletion(-)<br></div><div><br></div><div>diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c<br></div><div>index 2991c002bd2..7edb374e77e 100644<br></div><div>--- a/modules/stream_filter/prefetch.c<br></div><div>+++ b/modules/stream_filter/prefetch.c<br></div><div>@@ -309,9 +309,11 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)<br></div><div>         return buflen;<br></div><div> <br></div><div>     vlc_mutex_lock(&sys->lock);<br></div><div>+    bool was_paused = sys->paused;<br></div><div>     if (sys->paused)<br></div><div>     {<br></div><div>-        msg_Err(stream, "reading while paused (buggy demux?)");<br></div><div>+        /* Reading while paused. Notify the thread to resume and put it back to<br></div><div>+         * sleep once the read is complete. */<br></div><div>         sys->paused = false;<br></div><div>         vlc_cond_signal(&sys->wait_space);<br></div><div>     }<br></div><div>@@ -340,6 +342,7 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)<br></div><div> <br></div><div>     memcpy(buf, sys->buffer + offset, copy);<br></div><div>     sys->stream_offset += copy;<br></div><div>+    sys->paused = was_paused;<br></div><div>     vlc_cond_signal(&sys->wait_space);<br></div><div>     vlc_mutex_unlock(&sys->lock);<br></div><div>     return copy;<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></body></html>