audio: explicitly document audio EOF condition

This should probably be an AO function, but since the playloop still has
some strange stuff (using the buffered_audio variable instead of calling
ao_get_delay() directly), just leave it and make it more explicit.
This commit is contained in:
wm4 2014-04-17 22:45:49 +02:00
parent 1b92f3b472
commit fe298bc2a5
2 changed files with 6 additions and 1 deletions

View File

@ -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;

View File

@ -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){