From b317b928196e984d53440da0cda8e3d3d9f9430c Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 3 Feb 2012 20:03:00 +0200 Subject: 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. --- libmpcodecs/vd_ffmpeg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index f407302d77..05bc318267 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -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) -- cgit v1.2.3