summaryrefslogtreecommitdiffstats
path: root/demux/demux.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-08 22:04:35 +0200
committerwm4 <wm4@nowhere>2015-07-08 22:04:35 +0200
commit23220db92443a5748cb034edf29b4c3b428bee5a (patch)
treefc49c36cf2a3b828a06d5dbed7a3136aa6e3e02f /demux/demux.c
parent15581f2209898bdd1747d4a32f57a00ba5098fdd (diff)
downloadmpv-23220db92443a5748cb034edf29b4c3b428bee5a.tar.bz2
mpv-23220db92443a5748cb034edf29b4c3b428bee5a.tar.xz
player: disable seeking even if the cache is enabled
Until now, if a stream wasn't seekable, but the stream cache was enabled (--cache), we've enabled seeking anyway. The idea was that at least short seeks would typically fall within the cache. And if not, the user was out of luck and terrible things happened. In other words, it was unreliable. Be stricter about it and remove this behavior. Effectively, this will for example disable seeking in piped data. Instead of trying to be clever, add an --force-seekable option, which will always enable seeking if the user really wants it.
Diffstat (limited to 'demux/demux.c')
-rw-r--r--demux/demux.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/demux/demux.c b/demux/demux.c
index aa3308b87f..ff6bf40ec0 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -990,9 +990,8 @@ static struct demuxer *open_given_type(struct mpv_global *global,
mp_verbose(log, "Detected file format: %s\n", desc->desc);
if (!in->d_thread->seekable)
mp_verbose(log, "Stream is not seekable.\n");
- // Pretend we can seek if we can't seek, but there's a cache.
- if (!in->d_thread->seekable && stream->uncached_stream) {
- mp_verbose(log, "Enabling seeking because stream cache is active.\n");
+ if (!in->d_thread->seekable && demuxer->opts->force_seekable) {
+ mp_warn(log, "Not seekable, but enabling seeking on user request.\n");
in->d_thread->seekable = true;
in->d_thread->partially_seekable = true;
}