From 70f4721574eec22417079044db4f8a1337aa0569 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 19 Sep 2014 22:38:00 +0200 Subject: player: reset last_av_difference if not applicable Don't let stale values linger around. Also fix a slightly related case in audio.c. --- player/audio.c | 1 + player/video.c | 1 + 2 files changed, 2 insertions(+) diff --git a/player/audio.c b/player/audio.c index 5de4fd449e..c74032f174 100644 --- a/player/audio.c +++ b/player/audio.c @@ -409,6 +409,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) if (opts->insert_silence) { float S = 0.5; if (!mpctx->paused && mpctx->audio_status == STATUS_PLAYING && + mpctx->video_status == STATUS_PLAYING && mpctx->last_av_difference - mpctx->insert_silence > S) mpctx->insert_silence += S; diff --git a/player/video.c b/player/video.c index 5b7048e2b4..865b38be43 100644 --- a/player/video.c +++ b/player/video.c @@ -641,6 +641,7 @@ static void update_avsync_before_frame(struct MPContext *mpctx) static void update_avsync_after_frame(struct MPContext *mpctx) { mpctx->time_frame -= get_relative_time(mpctx); + mpctx->last_av_difference = 0; if (mpctx->audio_status != STATUS_PLAYING || mpctx->video_status != STATUS_PLAYING) -- cgit v1.2.3