[vlc-devel] [PATCH] stream: add stream_ForcedPeekNew

Rémi Denis-Courmont remi at remlab.net
Thu Sep 10 17:43:56 CEST 2015


Le 2015-09-10 18:18, Francois Cartegnie a écrit :
> Creates a stream_Memory like backend
> pointing to an existing stream to convert
> reads into peek only requests.

This will lead to nonobvious undefined reentrancy if the wrapper stream 
is passed to another thread.

As for wrapping an existing block of data as a stream, there are 
already (at least) 3 existing implementations (memory stream, SDP access 
and attachment access) doing essentially just that.

> Helps dealing with seekable only designed code

Yeah. We could make all streams seekable by archiving all previous 
bytes. I think it is somewhat obvious why this is not a good idea, even 
if it is logically possible. (Hint: what happens if you seek far ahead?)

> (using stream_Readline for exemple)

stream_ReadLine() does not seek to begin with!

If a demuxer needs to read up to 200KiB to detect the format, it most 
certainly should be restricted to truly seekable streams anyway 
(possibly even only fast seekable).

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list