<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi Remi</p>
<p>On 2016-10-24 11:33, Rémi Denis-Courmont wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Le maanantaina 24. lokakuuta 2016, 2.13.11 EEST Filip Roséen a écrit :</code></pre>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> If a seek request happens to refer to a position within the already
 read block, simply update the block so that it refers to the desired
 data.

 There is really no need for us to discard the block, only to ask the
 underlying stream to give us a new one (when we have the data we want
 already).</code></pre>
</blockquote>
<pre><code> I don´t see the point. I have spent a lot of time untangling the caching from 
 the generic byte stream reader, and this is just starting to bring it back in 
 and duplicate functionality.</code></pre>
</blockquote>
<p>I agree that we should keep the implementation simple and consise, and not duplicate functionality; but having the kind of support proposed is just a extremely minor subset of the functionality within other parts of the code.. and I think it make sense not to re-read data (just as we have the functionality in place for peeking).</p>
<p>One could even merge the peeking and block “cache” in <code>src/input/stream.c</code>, making the implementation even less complicated than it is now.</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> If you need to skip forward, call vlc_stream_Read(..., NULL, ...) in the 
 demuxer or wherever else needed. That will work even if the stream is not 
 readable.</code></pre>
</blockquote>
<p>I guess we should have a major clean-up session, because we have demuxers (such as <code>modules/demux/mp4</code> and <code>modules/demux/avi</code>), and other entities, that does a lot of seeking back and forth, and for block-based accessors this is killing performance (really bad).</p>
<p>Sure, they can be fixed to not discard already read data, but I find that having simple management of blocks within <code>src/input/stream.c</code> is not too complex.</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> -- 
 Rémi Denis-Courmont
 Nonsponsored VLC developer
 http://www.remlab.net/CV.pdf

 _______________________________________________
 vlc-devel mailing list
 To unsubscribe or modify your subscription options:
 https://mailman.videolan.org/listinfo/vlc-devel</code></pre>
</blockquote>
</body>
</html>