[mpi_dec_utils]: Fix -f option check issue

Change-Id: I5495e37f7cebd397b1cf86408702a621c661aeba
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2021-08-18 17:46:35 +08:00
parent 6c57191ffb
commit 6da83e59c3

View File

@@ -198,7 +198,7 @@ RK_S32 mpi_dec_test_parse_options(int argc, char **argv, MpiDecTestCmd* cmd)
const char *next; const char *next;
RK_S32 optindex = 1; RK_S32 optindex = 1;
RK_S32 handleoptions = 1; RK_S32 handleoptions = 1;
RK_S32 err = MPP_NOK; RK_S32 err = MPP_OK;
if ((argc < 2) || (cmd == NULL)) { if ((argc < 2) || (cmd == NULL)) {
err = 1; err = 1;
@@ -296,10 +296,15 @@ RK_S32 mpi_dec_test_parse_options(int argc, char **argv, MpiDecTestCmd* cmd)
case 'f' : { case 'f' : {
if (next) { if (next) {
cmd->format = (MppFrameFormat)atoi(next); cmd->format = (MppFrameFormat)atoi(next);
if (!MPP_FRAME_FMT_IS_YUV(cmd->format) &&
!MPP_FRAME_FMT_IS_RGB(cmd->format))
err = 1;
} }
if (!next || err) { if (!next || err) {
mpp_err("invalid input coding type\n"); mpp_err("invalid output format\n");
cmd->format = MPP_FMT_BUTT;
goto PARSE_OPINIONS_OUT; goto PARSE_OPINIONS_OUT;
} }
} break; } break;