From 23220db92443a5748cb034edf29b4c3b428bee5a Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 8 Jul 2015 22:04:35 +0200 Subject: 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. --- options/options.c | 2 ++ options/options.h | 1 + 2 files changed, 3 insertions(+) (limited to 'options') diff --git a/options/options.c b/options/options.c index d92a0eef5d..7523be990a 100644 --- a/options/options.c +++ b/options/options.c @@ -243,6 +243,8 @@ const m_option_t mp_opts[] = { OPT_INTRANGE("demuxer-readahead-packets", demuxer_min_packs, 0, 0, MAX_PACKS), OPT_INTRANGE("demuxer-readahead-bytes", demuxer_min_bytes, 0, 0, MAX_PACK_BYTES), + OPT_FLAG("force-seekable", force_seekable, 0), + OPT_DOUBLE("cache-secs", demuxer_min_secs_cache, M_OPT_MIN, .min = 0), OPT_FLAG("cache-pause", cache_pausing, 0), diff --git a/options/options.h b/options/options.h index 9d211390e0..b43e28a06f 100644 --- a/options/options.h +++ b/options/options.h @@ -199,6 +199,7 @@ typedef struct MPOpts { double demuxer_min_secs; char *audio_demuxer_name; char *sub_demuxer_name; + int force_seekable; double demuxer_min_secs_cache; int cache_pausing; -- cgit v1.2.3