video: take first frame into account in audio-sync mode

It appears commit 4ad68d9452 broke handling the first video
frame duration through roundabout ways (I think because the duration of
the first frame was now available at all in the normal case). The first
frame was cut short, which showed up especially with looping, or if the
file had a low FPS.

This questionable change seems to fix it without breaking any other
known cases => push and call it a day.

The display-sync mode did not have this problem.

Fixes: #7150
This commit is contained in:
wm4 2019-11-16 13:47:23 +01:00
parent b6413f82b2
commit 6bbf44d842
1 changed files with 2 additions and 3 deletions

View File

@ -384,10 +384,9 @@ static void handle_new_frame(struct MPContext *mpctx)
}
}
mpctx->delay -= frame_time;
if (mpctx->video_status >= STATUS_PLAYING) {
mpctx->time_frame += frame_time / mpctx->video_speed;
mpctx->time_frame += frame_time / mpctx->video_speed;
if (mpctx->video_status >= STATUS_PLAYING)
adjust_sync(mpctx, pts, frame_time);
}
MP_TRACE(mpctx, "frametime=%5.3f\n", frame_time);
}