From 311ce60b16faa2254e17d4f25238845c2ece8f9f Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Aug 2014 21:51:26 +0200 Subject: video: exit early when nothing to do These cases were probably confusing. Exit early, which makes it much clearer what's going on. Should not change anything functionally. --- player/video.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 77fec470b4..6ea42ea842 100644 --- a/player/video.c +++ b/player/video.c @@ -637,6 +637,13 @@ void write_video(struct MPContext *mpctx, double endpts) if (!mpctx->d_video) return; + // Actual playback starts when both audio and video are ready. + if (mpctx->video_status == STATUS_READY) + return; + + if (mpctx->paused && mpctx->video_status >= STATUS_READY) + return; + update_fps(mpctx); double frame_time = 0; @@ -680,13 +687,6 @@ void write_video(struct MPContext *mpctx, double endpts) MP_TRACE(mpctx, "filtering more video\n"); } - // Actual playback starts when both audio and video are ready. - if (mpctx->video_status == STATUS_READY) - return; - - if (mpctx->paused && mpctx->video_status >= STATUS_READY) - return; - mpctx->time_frame -= get_relative_time(mpctx); if (!mpctx->sync_audio_to_video || mpctx->video_status < STATUS_READY) { mpctx->time_frame = 0; -- cgit v1.2.3