diff options
author | wm4 <wm4@nowhere> | 2015-07-08 22:04:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-07-08 22:04:35 +0200 |
commit | 23220db92443a5748cb034edf29b4c3b428bee5a (patch) | |
tree | fc49c36cf2a3b828a06d5dbed7a3136aa6e3e02f /demux/demux.c | |
parent | 15581f2209898bdd1747d4a32f57a00ba5098fdd (diff) | |
download | mpv-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.c | 5 |
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; } |