Skip to content

Commit

Permalink
Revert "player/video: loosen logic checks for adjust_sync"
Browse files Browse the repository at this point in the history
This reverts commit cb2b579.

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.
  • Loading branch information
llyyr authored and Dudemanguy committed Jan 21, 2024
1 parent 27359c3 commit b0e6ac3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions player/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit b0e6ac3

Please sign in to comment.