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

stream: handle seek across EOF correctly (hopefully)

parent a3ecaf15
......@@ -1102,14 +1102,14 @@ static int AStreamPeekStream( stream_t *s, const uint8_t **pp_peek, unsigned int
/* Be sure we will read something */
p_sys->stream.i_used += tk->i_start + p_sys->stream.i_offset + i_read - tk->i_end;
}
if( AStreamRefillStream( s ) ) break;
}
if( tk->i_end < tk->i_start + p_sys->stream.i_offset + i_read )
if( AStreamRefillStream( s ) )
{
if( tk->i_end < tk->i_start + p_sys->stream.i_offset )
return 0; /* EOF */
i_read = tk->i_end - tk->i_start - p_sys->stream.i_offset;
break;
}
}
/* Now, direct pointer or a copy ? */
i_off = (tk->i_start + p_sys->stream.i_offset) % STREAM_CACHE_TRACK_SIZE;
......
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