diff options
author | wm4 <wm4@nowhere> | 2016-09-16 14:24:15 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-16 14:39:45 +0200 |
commit | 03fec24e192ea1b5c0cf957a5a64c0db9d33e67a (patch) | |
tree | 75f58b93ce56c3f6cd3afdbd3ce028f93dcf35bb /player/video.c | |
parent | b8ade7c99b830ee9870040bcfc1f2c3d3a64d172 (diff) | |
download | mpv-03fec24e192ea1b5c0cf957a5a64c0db9d33e67a.tar.bz2 mpv-03fec24e192ea1b5c0cf957a5a64c0db9d33e67a.tar.xz |
player: litter code with explicit wakeup calls
This does 3 kinds of changes:
- change sleeptime=x to mp_set_timeout()
- change sleeptime=0 to mp_wakeup_core() calls (to be more explicit)
- change commands etc. to call mp_wakeup_core() if they do changes that
require the playloop to be rerun
This is preparation for the following changes. The goal is to process
client API requests without having to rerun the playloop every time. As
of this commit, the changes should not change behavior. In particular,
the playloop is still implicitly woken up on every command.
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/player/video.c b/player/video.c index e66426f24d..4c56ca1a00 100644 --- a/player/video.c +++ b/player/video.c @@ -706,7 +706,7 @@ static int video_feed_async_filter(struct MPContext *mpctx) if (vf_needs_input(vf) < 1) return 0; - mpctx->sleeptime = 0; // retry until done + mp_wakeup_core(mpctx); // retry until done return video_decode_and_filter(mpctx); } @@ -1376,7 +1376,7 @@ void write_video(struct MPContext *mpctx) if (mpctx->video_status == STATUS_DRAINING) { mpctx->time_frame -= get_relative_time(mpctx); - mpctx->sleeptime = MPMIN(mpctx->sleeptime, mpctx->time_frame); + mp_set_timeout(mpctx, mpctx->time_frame); if (mpctx->time_frame <= 0) { MP_VERBOSE(mpctx, "video EOF reached\n"); mpctx->video_status = STATUS_EOF; @@ -1391,7 +1391,7 @@ void write_video(struct MPContext *mpctx) mpctx->video_status = STATUS_PLAYING; if (r != VD_NEW_FRAME) { - mpctx->sleeptime = 0; // Decode more in next iteration. + mp_wakeup_core(mpctx); // Decode more in next iteration. return; } @@ -1519,7 +1519,7 @@ void write_video(struct MPContext *mpctx) mpctx->max_frames--; } - mpctx->sleeptime = 0; + mp_wakeup_core(mpctx); return; error: @@ -1527,5 +1527,5 @@ error: uninit_video_chain(mpctx); error_on_track(mpctx, track); handle_force_window(mpctx, true); - mpctx->sleeptime = 0; + mp_wakeup_core(mpctx); } |