summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index fc3bb97a96..48813c80a0 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1534,6 +1534,19 @@ static void play_current_file(struct MPContext *mpctx)
goto terminate_playback;
}
+ demux_start_prefetch(mpctx->demuxer);
+
+ if (opts->demuxer_cache_wait) {
+ while (!mpctx->stop_play) {
+ struct demux_reader_state s;
+ demux_get_reader_state(mpctx->demuxer, &s);
+ if (s.idle)
+ break;
+
+ mp_idle(mpctx);
+ }
+ }
+
double play_start_pts = get_play_start_pts(mpctx);
if (play_start_pts != MP_NOPTS_VALUE) {
/*