summaryrefslogtreecommitdiffstats
path: root/player/misc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-10-02 19:57:01 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commitc91e659f88450bee3937bdef4338903c508cbba2 (patch)
treec4ded0e89bf343ad2c98d06822a38a91251737a4 /player/misc.c
parentca142be7e8c42d8fbc21935ee3f3db2b6d2f457c (diff)
downloadmpv-c91e659f88450bee3937bdef4338903c508cbba2.tar.bz2
mpv-c91e659f88450bee3937bdef4338903c508cbba2.tar.xz
stream: redo buffer handling and allow arbitrary size for stream_peek()
struct stream used to include the stream buffer, including peek buffer, inline in the struct. It could not be resized, which means the maximum peek size was set in stone. This meant demux_lavf.c could peek only so much data. Change it to use a dynamic buffer. Because it's possible, keep the inline buffer for default buffer sizes (which are basically always used outside of file opening). It's unknown whether it really helps with anything. Probably not. This is also the fallback plan in case we need something like the old stream cache in order to deal with mp4 + unseekable http: the code can now be easily changed to use any buffer size.
Diffstat (limited to 'player/misc.c')
-rw-r--r--player/misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/misc.c b/player/misc.c
index ce353b9590..633ec6917d 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -301,7 +301,7 @@ int stream_dump(struct MPContext *mpctx, const char *source_filename)
MP_MSG(mpctx, MSGL_STATUS, "Dumping %lld/%lld...",
(long long int)pos, (long long int)size);
}
- bstr data = stream_peek(stream, STREAM_MAX_BUFFER_SIZE);
+ bstr data = stream_peek(stream, 4096);
if (data.len == 0) {
ok &= stream->eof;
break;