From 559a400ac36e75a8d73ba263fd7fa6736df1c2da Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 31 Aug 2018 12:48:36 +0200 Subject: demux, stream: rip out the classic stream cache The demuxer cache is the only cache now. Might need another change to combat seeking failures in mp4 etc. The only bad thing is the loss of cache-speed, which was sort of nice to have. --- player/playloop.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index fa1cc544cb..59e3211df9 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -627,14 +627,11 @@ static void handle_pause_on_low_cache(struct MPContext *mpctx) double now = mp_time_sec(); - struct stream_cache_info c = {.idle = true}; - demux_stream_control(mpctx->demuxer, STREAM_CTRL_GET_CACHE_INFO, &c); - struct demux_ctrl_reader_state s = {.idle = true, .ts_duration = -1}; demux_control(mpctx->demuxer, DEMUXER_CTRL_GET_READER_STATE, &s); int cache_buffer = 100; - bool use_pause_on_low_cache = (c.size > 0 || mpctx->demuxer->is_network) && + bool use_pause_on_low_cache = demux_is_network_cached(mpctx->demuxer) && opts->cache_pause; if (!mpctx->restart_complete) { @@ -669,7 +666,7 @@ static void handle_pause_on_low_cache(struct MPContext *mpctx) } // Also update cache properties. - bool busy = !s.idle || !c.idle; + bool busy = !s.idle; if (busy || mpctx->next_cache_update > 0) { if (mpctx->next_cache_update <= now) { mpctx->next_cache_update = busy ? now + 0.25 : 0; -- cgit v1.2.3