From e277fadd60350caad1fc31e92a5076692e61dcc9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Jan 2017 19:02:50 +0100 Subject: player: add prefetching of the next playlist entry Since for mpv CLI, the player state is a singleton, full prefetching is a bit tricky. We do it only on the demuxer layer. The implementation reuses the old "open thread". This means there is significant potential for regressions even if the new option is not used. This is made worse by the fact that I barely tested this code. The generic mpctx_run_reentrant() wrapper is also removed - this was its only user, and its remains become part of the new implementation. --- player/playloop.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 9db9396f95..232a75f814 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -663,6 +663,9 @@ static void handle_pause_on_low_cache(struct MPContext *mpctx) force_update = true; } + if (s.eof && !busy) + prefetch_next(mpctx); + if (force_update) mp_notify(mpctx, MP_EVENT_CACHE_UPDATE, NULL); } -- cgit v1.2.3 From 96a45a16af5594900ca94e7d4abb18d1e6d5ed4a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 7 Feb 2017 17:05:17 +0100 Subject: player: add experimental stream recording feature This is basically a WIP, but it can't remain in a branch forever. A warning is print when using it as it's still a bit "shaky". --- player/playloop.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 232a75f814..e73ad61788 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -28,6 +28,7 @@ #include "options/options.h" #include "common/common.h" #include "common/encode.h" +#include "common/recorder.h" #include "options/m_config.h" #include "options/m_property.h" #include "common/playlist.h" @@ -330,6 +331,8 @@ static void mp_seek(MPContext *mpctx, struct seek_params seek) clear_audio_output_buffers(mpctx); reset_playback_state(mpctx); + if (mpctx->recorder) + mp_recorder_mark_discontinuity(mpctx->recorder); /* Use the target time as "current position" for further relative * seeks etc until a new video frame has been decoded */ -- cgit v1.2.3