vd_ffmpeg.c: Use FFmpeg-mt compatible code for codec delay

This code to calculate codec delay should work with both with regular
FFmpeg and FFmeg-mt. This MPlayer version is not completely compatible
with current FFmpeg-mt though, since it has a build system change
which matches upstream FFmpeg but hasn't been integrated in FFmpeg-mt
yet (RUNTIME_CPUDETECT -> CONFIG_RUNTIME_CPUDETECT rename).
This commit is contained in:
Uoti Urpala
2009-04-30 03:54:34 +03:00
parent 017fafac44
commit ce35ed0209
+8 -2
View File
@@ -126,8 +126,14 @@ static int control(sh_video_t *sh, int cmd, void *arg, ...){
case VDCTRL_RESYNC_STREAM:
avcodec_flush_buffers(avctx);
return CONTROL_TRUE;
case VDCTRL_QUERY_UNSEEN_FRAMES:
return avctx->has_b_frames + 10;
case VDCTRL_QUERY_UNSEEN_FRAMES:;
int delay = avctx->has_b_frames;
#ifdef FF_THREAD_FRAME
// FFmpeg-mt has extra delay when using frame threading
if (avctx->thread_type & FF_THREAD_FRAME)
delay += avctx->thread_count - 1;
#endif
return delay + 10;
}
return CONTROL_UNKNOWN;
}