summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-29 11:29:52 +0200
committerwm4 <wm4@nowhere>2016-03-29 11:29:52 +0200
commit57506b27ed0d567c11bd932cf758318fb3b2079c (patch)
treef9bfbdf9ca316546f6de72d16b837411cb95e423 /player/playloop.c
parente1264d397613b0dac86757d6fd3a4a3494e16868 (diff)
downloadmpv-57506b27ed0d567c11bd932cf758318fb3b2079c.tar.bz2
mpv-57506b27ed0d567c11bd932cf758318fb3b2079c.tar.xz
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.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c5
1 files changed, 3 insertions, 2 deletions
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);