Revert "player/video: loosen logic checks for adjust_sync"

This reverts commit cb2b579f61.

This breaks files where the audio starts much later after the video
since mpv reads the first audio packet even if it isn't supposed to
start yet, resulting in the audio_status being STATUS_READY for the
entire time mpv is "waiting" for the first audio packet to be played.
This commit is contained in:
llyyr 2024-01-21 23:40:50 +05:30 committed by Dudemanguy
parent 27359c3ff1
commit b0e6ac380f
1 changed files with 2 additions and 2 deletions

View File

@ -343,7 +343,7 @@ static void adjust_sync(struct MPContext *mpctx, double v_pts, double frame_time
{
struct MPOpts *opts = mpctx->opts;
if (mpctx->audio_status == STATUS_EOF)
if (mpctx->audio_status != STATUS_PLAYING)
return;
mpctx->delay -= frame_time;
@ -388,7 +388,7 @@ static void handle_new_frame(struct MPContext *mpctx)
}
}
mpctx->time_frame += frame_time / mpctx->video_speed;
if (frame_time)
if (mpctx->video_status >= STATUS_PLAYING)
adjust_sync(mpctx, pts, frame_time);
MP_TRACE(mpctx, "frametime=%5.3f\n", frame_time);
}