summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-24 14:33:34 +0100
committerAlessandro Ghedini <alessandro@ghedini.me>2015-01-14 17:03:28 +0100
commit34cbc9057c3d291c255d34fb71416882ce26c016 (patch)
treec463c7611941f4790eb223768a3a0c093e0dd859
parent36a2dd5ace39decdeb112947cd138eef95a7f724 (diff)
downloadmpv-34cbc9057c3d291c255d34fb71416882ce26c016.tar.bz2
mpv-34cbc9057c3d291c255d34fb71416882ce26c016.tar.xz
stream: always disable cache for pseudo-streams
Streams which don't have a full_buffer function never return any actual data. Slight improvement over commit 5640c195.
-rw-r--r--stream/stream.c3
-rw-r--r--stream/stream_edl.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 2a851e82ec..8b95ba7ee6 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -325,6 +325,9 @@ static int open_internal(const stream_info_t *sinfo, struct stream *underlying,
if (!s->read_chunk)
s->read_chunk = 4 * (s->sector_size ? s->sector_size : STREAM_BUFFER_SIZE);
+ if (!s->fill_buffer)
+ s->allow_caching = false;
+
assert(s->seekable == !!s->seek);
s->uncached_type = s->type;
diff --git a/stream/stream_edl.c b/stream/stream_edl.c
index c74aabf257..4873047cc2 100644
--- a/stream/stream_edl.c
+++ b/stream/stream_edl.c
@@ -7,7 +7,6 @@ static int s_open (struct stream *stream)
{
stream->type = STREAMTYPE_EDL;
stream->demuxer = "edl";
- stream->allow_caching = false;
return STREAM_OK;
}