This was done for the IAGSStream in plugin api in the first iteration,
but lost when fixing the api recently.
From upstream e248f320074d8430f14c1c4e513e5fb120e55eb2 and
76b49c0c7a4df46b06aebea86573999f29400809
It turns out our Stream's Seek return value is not defined, and not documented
either. But judging by the other Stream implementations, it was supposed to return
positive whenever there's NO ERROR, regardless of whether the position is matching
user's request.
I suppose we may also make Seek return the resulting position, similar to how some
other libs do (e.g. see SDL and .NET Framework).
From upstream 208fd913225d0732060744fa3b2377a265ad89a3
There have been this stupid oversight all along since the introduction
of the class: while it reported Length and EOS correctly, it still
allowed to read past the end.
This can cause issues if the user code relies, for example, on Read()
or ReadByte() return value.
For upstream code, in practice this fixes MP3 streaming, where the length
of data is not always possible to precalculate. In ScummVM we used a
different code for MP3, but this may fix other cases as well.
From upstream 6f02bedc65b902ce41858b7e92970662020a11cf
Part of upstream 82a928cb07970acc5918905c5836c39ce11b7f32
(Tests: added BufferedStream tests)
This commit has no functional change but allows to keep the code
in ScummVM close to upstream code.