From b625ced0af818255f2ff36336870fc78e4424b08 Mon Sep 17 00:00:00 2001 From: "sliver.chen" Date: Wed, 8 Nov 2017 10:57:03 +0800 Subject: [PATCH] [test]: add err info check when decode mpp will output error yuv data when process error input stream. We should check it and discard those error frame to avoid display error. Change-Id: I04423b5fad13e727594b06c217f491227e465fce Signed-off-by: sliver.chen --- test/mpi_dec_test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/mpi_dec_test.c b/test/mpi_dec_test.c index 3c1ccf77..20c8ca63 100644 --- a/test/mpi_dec_test.c +++ b/test/mpi_dec_test.c @@ -86,6 +86,7 @@ static int decode_simple(MpiDecLoopData *data) { RK_U32 pkt_done = 0; RK_U32 pkt_eos = 0; + RK_U32 err_info = 0; MPP_RET ret = MPP_OK; MppCtx ctx = data->ctx; MppApi *mpi = data->mpi; @@ -218,8 +219,13 @@ static int decode_simple(MpiDecLoopData *data) mpi->control(ctx, MPP_DEC_SET_INFO_CHANGE_READY, NULL); } else { + err_info = mpp_frame_get_errinfo(frame) | mpp_frame_get_discard(frame); + if (err_info) { + mpp_log("decoder_get_frame get err info:%d discard:%d.\n", + mpp_frame_get_errinfo(frame), mpp_frame_get_discard(frame)); + } mpp_log("decode_get_frame get frame %d\n", data->frame_count++); - if (data->fp_output) + if (data->fp_output && !err_info) dump_mpp_frame_to_file(frame, data->fp_output); } frm_eos = mpp_frame_get_eos(frame);