From f7341152cbcbcbae6633c04c4079c35875081b6c Mon Sep 17 00:00:00 2001 From: ChenHengming Date: Thu, 16 Jun 2016 11:51:56 +0000 Subject: [PATCH] [mpi_dec_test]: get_frame until return MppFrame is NULL git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@931 6e48237b-75ef-9749-8fc9-41990f28c85a --- test/mpi_dec_test.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/test/mpi_dec_test.c b/test/mpi_dec_test.c index 94447226..ed926f4c 100644 --- a/test/mpi_dec_test.c +++ b/test/mpi_dec_test.c @@ -163,23 +163,27 @@ int mpi_dec_test(MpiDecTestCmd *cmd) msleep(50); - ret = mpi->decode_get_frame(ctx, &frame); - if (MPP_OK != ret) { - mpp_err("decode_get_frame failed ret %d\n", ret); - goto MPP_TEST_OUT; - } - - if (frame) { - if (mpp_frame_get_info_change(frame)) { - mpp_log("decode_get_frame get info changed found\n"); - mpi->control(ctx, MPP_CODEC_SET_INFO_CHANGE_READY, NULL); - } else { - mpp_log("decode_get_frame get frame %d\n", frame_count++); - if (fp_output) - dump_mpp_frame_to_file(frame, fp_output); + do { + ret = mpi->decode_get_frame(ctx, &frame); + if (MPP_OK != ret) { + mpp_err("decode_get_frame failed ret %d\n", ret); + goto MPP_TEST_OUT; } - mpp_frame_deinit(&frame); - } + + if (frame) { + if (mpp_frame_get_info_change(frame)) { + mpp_log("decode_get_frame get info changed found\n"); + mpi->control(ctx, MPP_CODEC_SET_INFO_CHANGE_READY, NULL); + } else { + mpp_log("decode_get_frame get frame %d\n", frame_count++); + if (fp_output) + dump_mpp_frame_to_file(frame, fp_output); + } + mpp_frame_deinit(&frame); + } else { + break; + } + } while (1); } ret = mpi->reset(ctx);