Commit f9c09233 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: fix skipping data in stream-oriented access

Now that stream cache and stream/access wrapper are separated the later
must handle skipping data (by "reading into" a NULL buffer). This was
done correctly for block-oriented plugins, but not stream-oriented
ones. This patch simply adds a dummy buffer to read into in the
unlikely event that it is needed.

(Typically one of the stream cache plugins takes care of this, so this
bug was mostly invisible.)
Pointed-out-by: default avatarFilip Roséen <filip@videolabs.io>
parent 40608ad1
......@@ -254,6 +254,13 @@ static ssize_t AStreamReadStream(stream_t *s, void *buf, size_t len)
stream_sys_t *sys = s->p_sys;
input_thread_t *input = s->p_input;
ssize_t val = 0;
char dummy[(buf != NULL) ? 1 : (len <= 2048) ? len : 2048];
if (buf == NULL)
{
buf = dummy;
len = sizeof (dummy);
}
do
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment