Skip to content
5 changes: 5 additions & 0 deletions app/oapv_app_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ static void print_usage(const char **argv)

static int check_conf(oapve_cdesc_t *cdesc, args_var_t *vars)
{
// ensure frame width multiple of 2 in case of 422 format
if ((vars->input_csp == 2) && (cdesc->param[FRM_IDX].w & 0x1)) {
logerr("width should be a multiple of 2 for '--input-csp 2'\n");
return -1;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch is correct, but I'd like to recommend to use for loop with cdesc.max_num_frms.
Even though the cdesc.max_num_frms value is alwasy 1, the loop with cdesc.max_num_frms value would be much more flexible when we start to support multiple frames encoding in near future.

like this;

for (i < cdesc.max_num_frms) {
if ((vars->input_csp == 2) && (cdesc->param[i].w & 0x1)) {
logerr("%d-th frame's width should be a multiple of 2 for '--input-csp 2'\n", i);
return -1;
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the changes inside for loop to support multiple frames encoding

int i;
for(i = 0; i < cdesc->max_num_frms; i++) {
if(vars->hash && strlen(vars->fname_rec) == 0) {
Expand Down