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.
This commit is contained in:
wm4 2014-08-13 21:51:26 +02:00
parent d4e0fc76bb
commit 311ce60b16
1 changed files with 7 additions and 7 deletions

View File

@ -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;