vd_ffmpeg: adjust buffered frame count based on threads again

Libav has changed back to not modifying avctx->has_b_frames based on
the extra buffering caused by thread use. Add back the code to do the
adjustment on the player side once again.

The timing mode using the buffering info is no longer the default, so
in most cases having this right or not won't matter for playback.
This commit is contained in:
Uoti Urpala 2012-02-03 20:03:00 +02:00
parent fc6a9e4a3e
commit b317b92819
1 changed files with 2 additions and 0 deletions

View File

@ -821,6 +821,8 @@ static int control(sh_video_t *sh, int cmd, void *arg, ...)
return CONTROL_TRUE;
case VDCTRL_QUERY_UNSEEN_FRAMES:;
int delay = avctx->has_b_frames;
if (avctx->active_thread_type & FF_THREAD_FRAME)
delay += avctx->thread_count - 1;
return delay + 10;
case VDCTRL_RESET_ASPECT:
if (ctx->vo_initialized)