From 57506b27ed0d567c11bd932cf758318fb3b2079c Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Mar 2016 11:29:52 +0200 Subject: cache: use a single STREAM_CTRL for various cache info Instead of having a separate for each, which also requires separate additional caching in the demuxer. (The demuxer adds an indirection, since STREAM_CTRLs are not thread-safe.) Since this includes the cache speed, this should fix #3003. --- player/playloop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 63234812d4..fcbb86ac04 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -522,8 +522,9 @@ static void handle_pause_on_low_cache(struct MPContext *mpctx) if (!mpctx->demuxer) return; - int idle = -1; - demux_stream_control(mpctx->demuxer, STREAM_CTRL_GET_CACHE_IDLE, &idle); + struct stream_cache_info info = {0}; + demux_stream_control(mpctx->demuxer, STREAM_CTRL_GET_CACHE_INFO, &info); + int idle = info.size > 0 ? info.idle : -1; struct demux_ctrl_reader_state s = {.idle = true, .ts_duration = -1}; demux_control(mpctx->demuxer, DEMUXER_CTRL_GET_READER_STATE, &s); -- cgit v1.2.3