summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-19 22:38:00 +0200
committerwm4 <wm4@nowhere>2014-09-20 00:44:37 +0200
commit70f4721574eec22417079044db4f8a1337aa0569 (patch)
treebf59ecdafd7eb9200b1dc7c0623dfdcc54134ee9 /player
parentc86b4790a839a9e02f7ed95f229d41d829c09c99 (diff)
downloadmpv-70f4721574eec22417079044db4f8a1337aa0569.tar.bz2
mpv-70f4721574eec22417079044db4f8a1337aa0569.tar.xz
player: reset last_av_difference if not applicable
Don't let stale values linger around. Also fix a slightly related case in audio.c.
Diffstat (limited to 'player')
-rw-r--r--player/audio.c1
-rw-r--r--player/video.c1
2 files changed, 2 insertions, 0 deletions
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)