path: root/stream/stream_ffmpeg.c
diff options
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-11-23 03:41:29 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-11-23 03:47:34 +0200
commit34c8b502e9b0b23e9719c9f41bedee9e9c314a29 (patch)
tree0710ffc78eac372cd484c5382cc5b804d4dd51f7 /stream/stream_ffmpeg.c
parent5995bc175aea0417ce7ff7285c1c8fc84ebb5704 (diff)
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.
Diffstat (limited to 'stream/stream_ffmpeg.c')
1 files changed, 1 insertions, 1 deletions
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;