From f07778c8c13fafbe4a179bc4f27d6bb7d0d3ef32 Mon Sep 17 00:00:00 2001 From: Johnson Ding Date: Sat, 24 Dec 2022 15:19:56 +0800 Subject: [PATCH] [vproc]: Fix output frame repeated problem For IEP2, the first two frames will be deinterlaced at I1O1 mode. I5O2 mode only works when the 3rd frame arrived. Thus the 2nd frame will be deinterlaced twice and PTS will be repeated as following pattern: ------------------------------------- IEP in : 0 1 2 3 4 IEP out : 0 1 0.5 1 2.5 3 3.5 ------------------------------------- To fix this, just skip the 2nd frame processing. Change-Id: I2d66951a941a664da093f1b9edbdd73855c57060 Signed-off-by: Johnson Ding --- mpp/vproc/mpp_dec_vproc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mpp/vproc/mpp_dec_vproc.cpp b/mpp/vproc/mpp_dec_vproc.cpp index b3ea66d3..8fa4a699 100644 --- a/mpp/vproc/mpp_dec_vproc.cpp +++ b/mpp/vproc/mpp_dec_vproc.cpp @@ -497,6 +497,18 @@ static void dec_vproc_set_dei_v2(MppDecVprocCtxImpl *ctx, MppFrame frm) ctx->pd_mode = 1; ctx->detection = 0; } + } else if (ctx->prev_frm0 && ! ctx->prev_frm1) { + vproc_dbg_status("Wait for next frame to turn into I5O2"); + + if (ctx->out_buf0) { + mpp_buffer_put(ctx->out_buf0); + ctx->out_buf0 = NULL; + } + + if (ctx->out_buf1) { + mpp_buffer_put(ctx->out_buf1); + ctx->out_buf1 = NULL; + } } else { struct iep2_api_params params;