summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-24 22:15:31 +0200
committerwm4 <wm4@nowhere>2015-04-24 23:27:12 +0200
commit8d31ad85ec0ec49cc7f7f72c330f3570e57ceffe (patch)
tree12c3f28a839bd2501d7b884c79be8c00ea87bbec
parentad11d877a524101272da4aa6680010b124c2f130 (diff)
downloadmpv-8d31ad85ec0ec49cc7f7f72c330f3570e57ceffe.tar.bz2
mpv-8d31ad85ec0ec49cc7f7f72c330f3570e57ceffe.tar.xz
player: don't show A/V desync message in non-sense situations
last_av_difference can be MP_NOPTS_VALUE under certain circumstances (like no video timestamp yet). This triggered the desync message, because fabs(MP_NOPTS_VALUE) is quite a large value. We don't want to show a message in this situation.
-rw-r--r--player/video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/video.c b/player/video.c
index 78df2b2f0a..e96f7dad82 100644
--- a/player/video.c
+++ b/player/video.c
@@ -724,9 +724,9 @@ static void update_avsync_after_frame(struct MPContext *mpctx)
mpctx->last_av_difference = a_pos - mpctx->video_pts + opts->audio_delay;
if (mpctx->time_frame > 0)
mpctx->last_av_difference += mpctx->time_frame * opts->playback_speed;
- if (a_pos == MP_NOPTS_VALUE || mpctx->video_pts == MP_NOPTS_VALUE)
+ if (a_pos == MP_NOPTS_VALUE || mpctx->video_pts == MP_NOPTS_VALUE) {
mpctx->last_av_difference = MP_NOPTS_VALUE;
- if (fabs(mpctx->last_av_difference) > 0.5 && !mpctx->drop_message_shown) {
+ } else if (fabs(mpctx->last_av_difference) > 0.5 && !mpctx->drop_message_shown) {
MP_WARN(mpctx, "%s", av_desync_help_text);
mpctx->drop_message_shown = true;
}