summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
authorllyyr <llyyr.public@gmail.com>2024-01-21 23:40:50 +0530
committerDudemanguy <random342@airmail.cc>2024-01-21 18:59:04 +0000
commitb0e6ac380f6dd1a3196de0b2426f71a3e3f68bff (patch)
treeeaa415be71b98c989a16e974155ac29aa4513f54 /player/video.c
parent27359c3ff10f1221b599db6f54eb719d0d2386c9 (diff)
downloadmpv-b0e6ac380f6dd1a3196de0b2426f71a3e3f68bff.tar.bz2
mpv-b0e6ac380f6dd1a3196de0b2426f71a3e3f68bff.tar.xz
Revert "player/video: loosen logic checks for adjust_sync"
This reverts commit cb2b579f61764452652c6cf5c6a94ae5e67c77ed. 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.
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/video.c b/player/video.c
index baa6db8d84..20b6df68f6 100644
--- a/player/video.c
+++ b/player/video.c
@@ -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);
}