stream_ffmpeg: Fix reads near EOF

stream_ffmpeg used libavformat's url_read_complete() to read data.
However that function returns failure if it did not manage to read the
_full_ amount of data asked for, while the behavior we want is to
return any positive amount of data there was before end of file. This
caused attempts to read the last bytes in a file to fail. Fix by using
url_read() instead of url_read_complete(); even if some reads before
EOF return less than the full amount that should not be a problem.
This commit is contained in:
Uoti Urpala 2009-11-23 03:41:29 +02:00
parent 5995bc175a
commit 34c8b502e9
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ static const struct m_struct_st stream_opts = {
static int fill_buffer(stream_t *s, char *buffer, int max_len)
{
int r = url_read_complete(s->priv, buffer, max_len);
int r = url_read(s->priv, buffer, max_len);
return (r <= 0) ? -1 : r;
}