diff options
Diffstat (limited to 'player')
-rw-r--r-- | player/audio.c | 17 | ||||
-rw-r--r-- | player/command.c | 3 | ||||
-rw-r--r-- | player/video.c | 2 |
3 files changed, 18 insertions, 4 deletions
diff --git a/player/audio.c b/player/audio.c index 27be10a4de..9634891283 100644 --- a/player/audio.c +++ b/player/audio.c @@ -147,8 +147,23 @@ int reinit_audio_filters(struct MPContext *mpctx) if (!ao_c) return 0; + double delay = 0; + if (ao_c->af->initialized > 0) + delay = af_calc_delay(ao_c->af); + af_uninit(ao_c->af); - return recreate_audio_filters(mpctx) < 0 ? -1 : 1; + if (recreate_audio_filters(mpctx) < 0) + return -1; + + // Only force refresh if the amount of dropped buffered data is going to + // cause "issues" for the A/V sync logic. + if (mpctx->audio_status == STATUS_PLAYING && + mpctx->playback_pts != MP_NOPTS_VALUE && delay > 0.2) + { + queue_seek(mpctx, MPSEEK_ABSOLUTE, mpctx->playback_pts, + MPSEEK_EXACT, true); + } + return 1; } // Call this if opts->playback_speed or mpctx->speed_factor_* change. diff --git a/player/command.c b/player/command.c index 997d60591c..96f9dd0819 100644 --- a/player/command.c +++ b/player/command.c @@ -4044,9 +4044,6 @@ static int set_filters(struct MPContext *mpctx, enum stream_type mediatype, reinit_filters(mpctx, mediatype); } - if (mediatype == STREAM_VIDEO) - mp_force_video_refresh(mpctx); - return success ? 0 : -1; } diff --git a/player/video.c b/player/video.c index 4179690416..9768a53b85 100644 --- a/player/video.c +++ b/player/video.c @@ -226,6 +226,8 @@ int reinit_video_filters(struct MPContext *mpctx) if (need_reconfig) filter_reconfig(vo_c); + mp_force_video_refresh(mpctx); + mp_notify(mpctx, MPV_EVENT_VIDEO_RECONFIG, NULL); return vo_c->vf->initialized; |