diff options
-rw-r--r-- | audio/out/ao.h | 5 | ||||
-rw-r--r-- | player/playloop.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/audio/out/ao.h b/audio/out/ao.h index e462fcf4d5..056cdf7295 100644 --- a/audio/out/ao.h +++ b/audio/out/ao.h @@ -49,6 +49,11 @@ typedef struct ao_control_vol { float right; } ao_control_vol_t; +// If ao_get_delay() reaches this value after ao_play() was called with the +// AOPLAY_FINAL_CHUNK flag set, the playback core expects that the audio has +// all been played. +#define AO_EOF_DELAY 0.05 + struct ao; struct mpv_global; struct input_ctx; diff --git a/player/playloop.c b/player/playloop.c index 2495579c39..61a2ac0c20 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -1219,7 +1219,7 @@ void run_playloop(struct MPContext *mpctx) * buffered. */ if ((mpctx->d_audio || mpctx->d_video) && !audio_left && !video_left - && (opts->gapless_audio || buffered_audio < 0.05) + && (opts->gapless_audio || buffered_audio < AO_EOF_DELAY) && (!mpctx->paused || was_restart)) { if (end_is_chapter) { mp_seek(mpctx, (struct seek_params){ |