core: add timing workaround for PulseAudio misbehavior

PulseAudio could keep reporting high delay values after a reset of
playing audio. This broke playback after seeking in some cases. Add a
workaround that should make things more robust against such
misbehavior.
This commit is contained in:
Uoti Urpala 2011-01-01 05:37:28 +02:00
parent d76ad5f227
commit 30c5994382
1 changed files with 3 additions and 0 deletions

View File

@ -2250,6 +2250,9 @@ static int sleep_until_near_frame(struct MPContext *mpctx, float *time_frame,
double audio_limit = 2;
current_module="calc_sleep_time";
if (mpctx->restart_playback)
return 0;
*time_frame -= get_relative_time(mpctx); // reset timer
if (mpctx->sh_audio && !mpctx->d_audio->eof) {