diff options
author | wm4 <wm4@nowhere> | 2014-08-13 21:51:26 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-13 21:51:26 +0200 |
commit | 311ce60b16faa2254e17d4f25238845c2ece8f9f (patch) | |
tree | 182df2048e2fe1d8c5fba1531a1946acebdef3c8 /player | |
parent | d4e0fc76bbddef2f8687e19b84c457c247bc2994 (diff) | |
download | mpv-311ce60b16faa2254e17d4f25238845c2ece8f9f.tar.bz2 mpv-311ce60b16faa2254e17d4f25238845c2ece8f9f.tar.xz |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/video.c | 14 |
1 files changed, 7 insertions, 7 deletions
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; |