From 34c8b502e9b0b23e9719c9f41bedee9e9c314a29 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Mon, 23 Nov 2009 03:41:29 +0200 Subject: 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. --- stream/stream_ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/stream_ffmpeg.c b/stream/stream_ffmpeg.c index c681dc2c88..6743720ffe 100644 --- a/stream/stream_ffmpeg.c +++ b/stream/stream_ffmpeg.c @@ -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; } -- cgit v1.2.3