summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index bae0224e02..923fec308b 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -722,6 +722,19 @@ static int control(struct dec_video *vd, int cmd, void *arg)
case VDCTRL_RESET:
reset_avctx(vd);
return CONTROL_TRUE;
+ case VDCTRL_QUERY_UNSEEN_FRAMES: {
+ AVCodecContext *avctx = ctx->avctx;
+ if (!ctx)
+ break;
+ if (ctx->hwdec && ctx->hwdec->type == HWDEC_RPI)
+ break; // MMAL has arbitrary buffering, thus unknown
+ int delay = avctx->has_b_frames;
+ assert(delay >= 0);
+ if (avctx->active_thread_type & FF_THREAD_FRAME)
+ delay += avctx->thread_count - 1;
+ *(int *)arg = delay;
+ return CONTROL_TRUE;
+ }
case VDCTRL_GET_HWDEC: {
int hwdec = ctx->hwdec ? ctx->hwdec->type : 0;
if (!ctx->software_fallback_decoder)